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.


Help with main_cc_embed

Login / Search

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

Community saint

I decided that the best solution to displaying catalog images on the front page is to use main_cc_embed and then change the display template (I don't want a table).

My first problem is that I cannot select multiple categories- when I try, I get the message "There are no entries at this time". I know this is incorrect because I am pulling the data from the same catalogs right above this using a main_multi-content block and all my images display. Below is the block code created using the 'Block construction assistant':

Code

 [block="14" select="14-23" display_type="0"]main_cc_embed[/block]

What am I doing wrong here?

Also, can I add a parameter to select recent entries? I know I could use main_recent_cc_entries but it seems that main_cc_embed is designed for exactly my usage ("Typical use: If you wish to have a page that is based on the entries in a catalogue, yet embedded within a Comcode page so that you can decorate around the entries").

My other issue is how do I create a new display type (just some divs floated left and right)? Is the correct template CATALOGUE_DEFAULT_ENTRY_EMBED.tpl? Is it best to use to just change the existing templates or does it make more sense to create a custom template set (I will also be changing the main catalog display)?

Thanks for any help.

Bob

Back to the top
 
Posted
Rating:
#70433
Avatar

Hi,

I just have time to address the first question. By what you've written, I get the picture "14-23" is meant to be a range of category IDs. However, the parameter is meant to be an ocFilter working on entries, not categories. What you actually need is "14*,15*,16*,17*,18*,19*,20*,21*,22*,23*".
'*' is the ocFilter notation for looking for entries somewhere underneath a category (it'll do a subtree search).


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:
#70437
Avatar

Community saint

BobS said

My other issue is how do I create a new display type (just some divs floated left and right)? Is the correct template CATALOGUE_DEFAULT_ENTRY_EMBED.tpl? Is it best to use to just change the existing templates or does it make more sense to create a custom template set (I will also be changing the main catalog display)?

Thanks for any help.

Bob

Short answer: yes, create a custom template set. The quick and easy way to handle this is to view your catalogue then select "Templates" from the dev drop down in the footer. In the list of resulting templates you should see both the default and a matching one with your catalogue name as part of the template name. Open the default for viewing, copy and paste into the corresponding custom. Seemingly a bit of a pain, using a tabbed browser and opening each template in a separate tab, process takes just a jiff and done. You can then customize until your hearts content without modding the defaults.

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#70440
Avatar

Community saint

Sheeeeesh!

Two and a half years of 'knowledge' gleaned in just THREE posts.

Thanks, guys!

 :thumbs:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#70441
Avatar

Community saint

*chuckle*, one of the things I love about ocPortal: it is perpetually like finding those kewl new toys in the toybox! ;)

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#70450
Avatar

Community saint

Thanks, Chris. I should have caught this. I just reread the ocFilter docs so hopefully they will stick better this time. The trouble with getting older is that you just don't remember stuff as quickly.

I just realized in looking at my page where I am displaying the content using main_multi_content and main_cc_embed that the layout for the catalog entry is the same. Does main_cc_embed have any "magic" mode params like "recent" or "random". This could be handy for inclusion on a Comcode page.

Since main_multi_content supports a "recent" mode, I'm thinking that I should maybe stick with that. Do both main_multi_content and main_cc_embed use CATALOGUE_DEFAULT_ENTRY_EMBED.tpl for the layout?

Thanks for your help.

Bob

Chris Graham said

Hi,

I just have time to address the first question. By what you've written, I get the picture "14-23" is meant to be a range of category IDs. However, the parameter is meant to be an ocFilter working on entries, not categories. What you actually need is "14*,15*,16*,17*,18*,19*,20*,21*,22*,23*".
'*' is the ocFilter notation for looking for entries somewhere underneath a category (it'll do a subtree search).
Back to the top
 
Posted
Rating:
#70451
Avatar

Community saint

Here's another little trick for customizing:

Code

{+START,IF,{$EQ,{_TITLE*},Video Library}}
<div class="spacer_10">{$COMCODE,[image_right_top]general/video.png[/image_right_top]}</div>
{+END}
I wanted to have an icon representing video but only on the screen showing the root category, not on the subcategory pages. My catalogue name was "Video Library". The comcode is my own and I use it to place images as I prefer to have them in my theme folder and not the uploads folder so I just reused that comcode here.

Result:


"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#70452
Avatar

Community saint

Thanks, SoccerDad.

I had mastered templating in the e-commerce software I used but this is all a brave new world. I am catching on slowly.

Thanks for your help.

Bob


SoccerDad said

Short answer: yes, create a custom template set. The quick and easy way to handle this is to view your catalogue then select "Templates" from the dev drop down in the footer. In the list of resulting templates you should see both the default and a matching one with your catalogue name as part of the template name. Open the default for viewing, copy and paste into the corresponding custom. Seemingly a bit of a pain, using a tabbed browser and opening each template in a separate tab, process takes just a jiff and done. You can then customize until your hearts content without modding the defaults.
Back to the top
 
Posted
Rating:
#70457
Avatar

Community saint

Happy to help Bob and like most of us here, we've been down the path you are travelling with our own struggles along the way. In the end, IMHO anyway, it's worth the journey…

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#70464
Avatar

Community saint

SoccerDad-

Wouldn't I be better off putting my changes in /themes/my_themes/templates_custom to make them more resilient to future upgrades?

Bob
Back to the top
 
Posted
Rating:
#70465
Avatar

Community saint

Hi SoccerDad-

I'm having no joy with this.

I have gone to my catalog entry page and selected "Templates" from the dropdown. I choose CATALOGUE_DEFAULT_ENTRY.tpl and copy the code I want, then I go back to the template list and choose CATALOGUE_image_galleries_ENTRY.tpl from the list and paste my code in. I hit the save button and then recheck it only to find CATALOGUE_image_galleries_ENTRY.tpl empty.

I know that I am doing things slightly different to what you described but this seemed like it would be quicker and less prone to error since I don't have manually create CATALOGUE_image_galleries_ENTRY.tpl.

What am I doing wrong? Or is there a bug in the Save when using the template list?

Thanks for your help.

Bob



SoccerDad said

…The quick and easy way to handle this is to view your catalogue then select "Templates" from the dev drop down in the footer. In the list of resulting templates you should see both the default and a matching one with your catalogue name as part of the template name. Open the default for viewing, copy and paste into the corresponding custom.
Back to the top
 
Posted
Rating:
#70466
Avatar

Community saint

Yupper…using the method outlined above for template editing (that is, ocPortal's built in template editor) the saved templates will automagically be put into your templates_custom folder and you'll be off to the races…it's a beautiful thing ;)

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#70467
Avatar

Community saint

Sounds like you are on the right track. What you may want to do if you haven't already, while developing, turn off the template caching from the config area. It's possible that the old templates are being cached and this saves you from having to clear caches by hand each time you make your changes.

BobS said

I know that I am doing things slightly different to what you described but this seemed like it would be quicker and less prone to error since I don't have manually create CATALOGUE_image_galleries_ENTRY.tpl.
The method I described above should not require you to create the custom template, it should already be in the templates list but just empty at this point…

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#70468
Avatar

Community saint

Which template list? The one generated from the dropdown or from "Edit templates" n the admin area? I see it in the former but not the latter.

I forgot to turn template caching off - perhaps that will help.

I appreciate all your help.

I feel like I am –> ← close to getting what I want done but am afraid Mr. Grumpy is gonna sneak up on me shortly.   :S

Bob
Back to the top
 
Posted
Rating:
#70469
Avatar

Community saint

Yes, the one generated from the dropdown at the bottom of the page you are viewing. It will show a custom template name but the file itself will be empty. Once you populate it and save, the template will be moved to the templates_custom folder.

There is a quick way to check: once you have created your custom template and cleared caches if required, view the page again and select the templates dropdown. The default template for whatever you've just edited should no longer be in the list…

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#70470
Avatar

Community saint

Well, turning off the template cache fixed the saving problem.

Now I just need to figure out how to structure this. Having 5 templates to display a simple table seems unnecessary but I am sure I am missing something.

For the front page, I want to do a div-left  with the fields displayed and a div-right with the image. No "Go-to-top" or link to the catelog entry button (I'll link form the painting title).

On the catalog entry page, it will be as above with an additional div for the description.

I am gonna get this done or else. I just know that I am so close.

Thanks again.

Bob
Back to the top
 
Posted
Rating:
#70474
Avatar

Community saint

I also thought the amount of templates for catalogues was a little overkill until I started down the customization road. In the end, loved the structure, gives you *almost* complete control over the output.

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#70477
Avatar

Community saint

Just had dinner so I am refreshed.

I think I have figured out how I will approach this. Hopefully, in a few hours I will be able to report at least some level of success.

Bob

Back to the top
 
Posted
Rating:
#70479
Avatar

Community saint

BobS said

Having 5 templates to display a simple table seems unnecessary but I am sure I am missing something.

I don't think you're missing anything. Many of the templates are far too small for my liking. Several times when I've tried to track a template down I've found only a part of it.

I'm sure there is a logical reason for it (i.e. efficiency/flexibility), but it does tend to put me off customising it, at least in a few situations.

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#70480
Avatar

Community saint

I think that the small TPLs just create a lot of flexibility for customization. But when you are trying to do something simple like I am, you kind of go "huh". Still, I am sure a day may come when I fully appreciate having to many places to add/change things.

I put all my changes in CATALOGUE_image_galleries_ENTRY.

Everything displays properly except that I am trying to get the image to float right and can't seem to remember how to do that.

Got it working on the front page too with the same problem. I made the Title field a link to the catalog entry. I need to figure out how to make that bold.

My MTML/CSS is really rusty. Haven't done anything in over a year and it all seems so distant.

Bob
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Expand