HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


problems with main_multi_content block

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#70090 (In Topic #14844)
Avatar

Community saint

I am having a devil of a time using the main_multi_content block. Since this is supposed to be the replacement for many of the existing main_* blocks, I decided to get in front of it and learn to use it. Well, I am not having much success.

First, there is the question of what the "efficient" setting does. Is it saying to disregard any permissions settings?

Second, when I create my page using the multi_content blocks, it displays in Safari (except for missing information covered below) but throws the following error in Firefox and Chrome:

Unfortunately a query has failed [SELECT r.* FROM ocp6_news g LEFT JOIN ocp6_group_category_access a ON (a.module_the_name='news' AND g.news_category=a.category_name) WHERE (a.group_id=1) AND (a.group_id IS NOT NULL) AND r.validated=1 ORDER BY r.id ASC LIMIT 10] [Unknown table 'r'] (version: 7.0.1, PHP version: 5.2.17, URL: /start.htm?keep_session=239443372) said


Not sure why I am getting a failed query.



I have basically created the same four blocks I already have on the start page using main_multi_content blocks. Here is what is happening:

  • The blog post displays okay but the RSS/Atom links are not included in the block. Is this a deliberate choice?
  • Post from some specific forums (12-23) display but the display is really not suitable for the front page of a site - it simply mimics the forum template and looks ugly.
  • A post to another forum (id=3) does not display although it does appear in the forum if you click the "Go to" Button
  • My gallery posts are not displaying. I am using the gallery names for id based on what displays in the Site Tree Editor. If you click the "Archives" link, the two posts appear.

I am sure that I am doing something wrong but can't figure out what it is.

And in the case of posts from the forum, their appearance should be tailored for display on a multi-block page, not simply mirror the forum post template with the avatar displayed.

Here's the code I used:
   <div class="fp_col_block" style="float: left">
      

      

      

   </div>
   <div class="fp_col_block" style="float: right">
      

   </div>

Anyone have any idea of what I might be doing wrong so I can just complain about what I find unattractive? Someone please set me straight.   :)

Thanks for your help.

Bob


EDIT: Silly that the code tag strips out code and a quote does not work either.

EDIT2: Attaching code as text
Attachment
» Download: multi_content.txt (752 Bytes, 103 downloads so far)


EDIT3: Since a picture is worth……


The left image is above the right image on the same page so they should be pulling the same data unless I just have something messed up.

EDIT4: Last edit for this post. I'm going to do some deep-breating exercises after this. Below is the main_multi_content part marked up with my complaints/problems:



Last edit: by BobS
Back to the top
 
Posted
Rating:
#70110
Avatar

Community saint

Sorry for being so snarky yesterday - it was a long and hellish day and this just put me over the edge as I felt I was doing right by trying to move from the deprecated blocks.

Some additional testing reveals that the page content is displayed properly for the admin account but fails for every other usergroups regardless of browser. Why would a SQL query be  dependent on usergroup?

Any thoughts?

Bob
Back to the top
 
Posted
Rating:
#70113
Avatar

Community saint

Further testing reveals that this error is reproducible if "efficient" is set to '0'.

I guess that confirms my understanding of what the "Efficient" setting does but there may be times when it is important to enforce permissions.

So, two of my issues down (with a fix needed) leaving just the on-page issues.

Bob
Back to the top
 
Posted
Rating:
#70131
Avatar

Community saint

Well, I realize (thanks to this post. thanks SoccerDad) that the main_multi_content block is only pulling the galleries listing rather than the contents of those galleries. I am not sure why it did not at least list the sub-galleries.

I tried main_gallery_embed which gets the pictures there but without any other information except the "Comments" link. What's needed is a main_multi_content option for displaying the gallery(s) with a title, submitter and posting date. Options should remain for "recent","top","Random", etc. The fact that this is already discussed elsewhere demonstrates that this is not an unusual requirement.

I understand that I can mod the templates, but something like this should be covered in the base code.

I love ocPortal but I am beginning to question if it is the right choice for sites based around collections of things (be it art, guns, stamps or toys).

Bob
Back to the top
 
Posted
Rating:
#70183
Avatar

Since this is supposed to be the replacement for many of the existing main_* blocks, I decided to get in front of it and learn to use it.

My intent of that topic was not to tell people what not to use, but to gather opinion on whether the transition made sense.
Work would be done to ensure main_multi_content cleanly can perform any use cases of the existing blocks before those were removed, and I suspect there would be some changes.
Also, the next major version of ocPortal could in theory be years away, I haven't implied it is around the corner ;).
Lastly, because the next major version will be a compatibility breaker, I expect it to stay as 'bleeding edge' for an extended period of time, e.g. 6 months (I plucked that figure from nowhere).

In summary: there is absolutely no reason to thinking about this kind of thing right now.

First, there is the question of what the "efficient" setting does. Is it saying to disregard any permissions settings?

Yes. We'll change the label to:
"Whether to skip category access checks, i.e. not consider permissions"

Second, when I create my page using the multi_content blocks, it displays in Safari (except for missing information covered below) but throws the following error in Firefox and Chrome

This will actually be related to your login. Probably on one your not logged in as an admin, and it's triggering an ocPortal bug.



Will reply some more soon, just got to do some other stuff first.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#70186
Avatar

Fix for SQL error attached.

Attachment
sources/blocks/main_multi_content.php
» Download: main_multi_content.php (19 Kb, 94 downloads so far)


The blog post displays okay but the RSS/Atom links are not included in the block. Is this a deliberate choice?

Yes and no. It is a generic block, not designed to have functionality beyond selecting and displaying items of a certain type of content.

Post from some specific forums (12-23) display but the display is really not suitable for the front page of a site - it simply mimics the forum template and looks ugly.

There are blocks designed for the much more tailored display of forum data (or catalogue data). This block is a very general-purpose utility that uses the same content display as the main_content block does (and typically the same also as search results). I expect in most cases significant re-themeing would be done based on whatever the intended end goal was. If we drop specific blocks and refer to this instead we will ensure it displays as intended, as the specific blocks were designed to support common use cases and we need to continue to support those. We are not currently designing each combination of parameters this block can take to look good out of the box. Consider that 1 year ago the block did not exist at all – just because something is possible in ocPortal via some kind of parameter scheme, does not mean it is optimal ;).

A post to another forum (id=3) does not display although it does appear in the forum if you click the "Go to" Button

Looking at your screenshot, you may have chosen a type of 'forum' instead of a type of 'topic'.
This block just displays literally what you ask it for, so if you ask it to display content of type 'forum' it will literally display a forum, not its contents. If you use 'topic' you can then use ocFilter to tell it to only grab topics from a specific forum.

My gallery posts are not displaying. I am using the gallery names for id based on what displays in the Site Tree Editor. If you click the "Archives" link, the two posts appear.

It has to be the codename's you enter when you add/edit a gallery, not the gallery title.

Silly that the code tag strips out code and a quote does not work either.

Looking at the post history I see it saved as the 'surround' tag, but it's possible the WYSIWYG editor broke what you typed, in which case please submit a step-by-step report of how to reproduce the problem.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#70194
Avatar

Community saint

Chris-

Thank you for taking the time to answer my questions in such detail.

Chris Graham said

Fix for SQL error attached.

Thanks for the fix.

Chris Graham said

The blog post displays okay but the RSS/Atom links are not included in the block. Is this a deliberate choice?

Yes and no. It is a generic block, not designed to have functionality beyond selecting and displaying items of a certain type of content.

So, basically, RSS is deprecated for the news/blogs type entries.

Chris Graham said

There are blocks designed for the much more tailored display of forum data (or catalogue data). This block is a very general-purpose utility that uses the same content display as the main_content block does (and typically the same also as search results). I expect in most cases significant re-themeing would be done based on whatever the intended end goal was. If we drop specific blocks and refer to this instead we will ensure it displays as intended, as the specific blocks were designed to support common use cases and we need to continue to support those. We are not currently designing each combination of parameters this block can take to look good out of the box. Consider that 1 year ago the block did not exist at all – just because something is possible in ocPortal via some kind of parameter scheme, does not mean it is optimal ;).

Chris Graham said

Looking at your screenshot, you may have chosen a type of 'forum' instead of a type of 'topic'.
This block just displays literally what you ask it for, so if you ask it to display content of type 'forum' it will literally display a forum, not its contents. If you use 'topic' you can then use ocFilter to tell it to only grab topics from a specific forum.

You called that perfectly - I was using "forum" instead of "topic" for the type. After changing this to "topic" things are working as I want and the posts are also displayed as they should be. I should have figured that I had missed something. I still personally prefer the old display from main_forums but this display is certainly acceptable and may, in fact, grow on me.

I'd like to make one suggestion. Currently, it appears that if the forum poster does not add a "Description", the post is displayed with "No summary available". I'd like to propose that you populate the "Description" field from the message text if "Description" is left empty. This will provide significant SEO benefits over repeated "No summery available" entries. Unfortunately, there is no way edit the "Description" field for existing posts.

Clearly, the documentation for main_multi_content needs some improving. I've run software development projects as well as have participated in open-source projects and know that documentation always falls behind. Hopefully, some member of the community can add this to the community documentation. I'd be happy to do it except that I am pressed to get this site launched and, more importantly, I am obviously clueless in the use and subtleties of main_multi-content.

Chris Graham said

It has to be the codename's you enter when you add/edit a gallery, not the gallery title.

I use the id displayed in the Site Tree Editor so that is not the issue. The problem for me is that I want something like main_gallery_embed but in list format with title, submitter, post date and concise description. It's not just that I don't like the current display, I think making the above changes would help greatly with SEO.



Chris Graham said

Looking at the post history I see it saved as the 'surround' tag, but it's possible the WYSIWYG editor broke what you typed, in which case please submit a step-by-step report of how to reproduce the problem.

I will see if I can duplicate the problem and provide a step-by-step.


Thanks again for your response and your effort.

Bob
Back to the top
 
Posted
Rating:
#70195
Avatar

So, basically, RSS is deprecated for the news/blogs type entries.

Nope, the main_news block isn't going anywhere :).

I'd like to make one suggestion. Currently, it appears that if the forum poster does not add a "Description", the post is displayed with "No summary available". I'd like to propose that you populate the "Description" field from the message text if "Description" is left empty. This will provide significant SEO benefits over repeated "No summery available" entries. Unfortunately, there is no way edit the "Description" field for existing posts.

I'd really just use main_forum_topics or main_forum_news.

You can edit topic descriptions though - there's a separate edit topic action on OCF.


I'm adding this to the block description "It's a building block, not designed to necessarily make things pretty without extra themeing – if there is a native block to use for the content type you want it may be better to use that".


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#70196
Avatar

Community saint

Okay, I misread your "Addons. little discussion" post. I thought you planned to drop most of the main_* blocks in favor of main_multi_content. I realize now that I am embarrassed with a wealth of choices.

It's so nice to have options.

Bob
Back to the top
 
Posted
Rating:
#70201
Avatar

Community saint

So, I've got things mostly ironed out. I decided to use main_forum_topics to display forum activity.

I've decided to stay with main_multi_content for the Blog as I like that the blog has a distinctive look (without needing to theme). The "add" link for the blog goes to cms/cms_news/ad.htm. Is there some way using the Redirect function to send it instead to cms/cms_blogs/ad.htm?

My only problem left for the front page is to have an image list sorted newest to oldest that shows image,image title, submitter, submission date and concise description.

Any thoughts on this? I guess I'll try SoccerDad's mod but I know I am going to hate that at each upgrade. It would be greatto have a template like SoccerDad's included in the base software. Or am I missing something obvious again?

Bob  
Back to the top
 
Posted
Rating:
#70202
Avatar

Is there some way using the Redirect function to send it instead to cms/cms_blogs/ad.htm?

No but you could find where in the template these add links these are spit out from (BLOCK_MAIN_MULTI_CONTENT of the top of my head, but I'm at home right now). Put {$REPLACE,news,blogs,...} around the outputted link parameter.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#70204
Avatar

Community saint

Am I right in guessing that it is best to put this in my own theme rather than the default. Will the upgrader script catch the change if it is in my own template?

Thanks for your help.

Bob

EDIT: Since I have no plans to use the "News" feature, I think I will just change the language variables from "news" to "blogs".

ButI would appreciate and answer to the above question.


Last edit: by BobS
Back to the top
 
Posted
Rating:
#70206
Avatar

Editing templates into your own theme is pretty safe, we rarely do anything so major as to break compatibility between patches.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#70207
Avatar

Community saint

I have almost got the front page looking as I want. I decided to use main_multi_content with type=image and mode=recent. This produces a nice list and although it lacks some of the information I'd like displayed, it is workable.

The one catch is that each image block displayed is titled "Image". I'd think for most people, it would be better to display the image name. Unfortunately, you do not provide a title field when adding images. This truly looks to me to be a major missing feature. Most items in a CMS have titles whether they are pages, galleries, images/videos or catalog entries.

Is there any possibility that this shortcoming might be addressed in the core code?

Bob
Back to the top
 
Posted
Rating:
#70236
Avatar

I posted a very long unofficial patch for that recently to a topic, but it's not so simple to change these kinds of things, it involves changing dozens of interfaces and changing the database structure.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#70245
Avatar

Community saint

Thanks for your reply, Chris.

I've decided to go with catalogs and just working the display template for the items. Wasn't in my initial plans prior to launch but I've got to start digging through the code sometime.

Bob
Back to the top
 
Posted
Rating:
#70275
Avatar

Community saint

Chris-

Just checking if I am understanding you correctly.

Would I wrap this bit of code with your suggestion:

Code

<a rel="add" href="{SUBMIT_URL*}">{!ADD}</a>

or do I need to find where SUBMIT_URL* is built.

Thanks for your help.

Bob

Chris Graham said

No but you could find where in the template these add links these are spit out from (BLOCK_MAIN_MULTI_CONTENT of the top of my head, but I'm at home right now). Put {$REPLACE,news,blogs,...} around the outputted link parameter.
Back to the top
 
Posted
Rating:
#70283
Avatar

Code

<a rel="add" href="{$REPLACE,news,blogs,{SUBMIT_URL*}}">{!ADD}</a>


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#70304
Avatar

Community saint

Thanks, that works perfectly and is so obvious in retrospect.

I have spent some time familiarizing myself with the code structure and plan to do the same with the database. Hopefully, I'll be up to speed shortly.

Thanks for your help.

Bob
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: