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.


Catalogue display questions

Login / Search

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

Well-settled

I have been playing around with the catalogues in v9 and have a few questions I hope folks can help me with.

1) I am using the BLOCK_MAIN_RECENT_CC_ENTRIES block on my links page to show the most recently added links.  Since the titles of the links are already displayed as clickable links, I wanted to remove the "URL" column.  But when I look at the block code all it has is

<h3>{!RECENT,{NUMBER*},{CATALOGUE_TITLE*}}</h3> &nbsp;   {CONTENT}

I don't see any way to control what columns are displayed.

2) I have added a new catalogue that will contain links to a bunch of research papers and articles.  This also has a title, URL, year published, and type of document in the catalogue.  But I noticed that the Title is not displayed as a link in this setup, unlike when the Links catalogue is displayed.  I was hoping to show the title as a clickable URL, not show the URL as a separate column, and add a new column that would show the date the catalogue entry was added.  

After looking at the templates, and trying to go through the tempcode info in the docs, I am baffled on how to go about making these changes.  There does not seem to be any documentation on what templates do what.  There also seem to be tempcode in the v9 that is not documented anywhere, such as the !Recent code.

Does anyone have any suggestions on how to make the changes above?  And can anyone point me at any documentation on what templates do what?  I'm not a programmer by any stretch, but I have programming in BASIC, Delphi, and Java a long time ago (BASIC was pre-windows, Delphi was with Win 3.1, and Java was back when it was first introduced).  So I figure I should be able to pick up at least the basics if someone can help point me in the right direction to set the foundation.

Thanks
Back to the top
 
Posted
Rating:
#90308
Avatar

Community saint

D-Train said

I have been playing around with the catalogues in v9 and have a few questions I hope folks can help me with.

1) I am using the BLOCK_MAIN_RECENT_CC_ENTRIES block on my links page to show the most recently added links.  Since the titles of the links are already displayed as clickable links, I wanted to remove the "URL" column.  But when I look at the block code all it has is

&lt;h3&gt;{!RECENT,{NUMBER*},{CATALOGUE_TITLE*}}&lt;/h3&gt; &amp;nbsp;&nbsp; &nbsp;{CONTENT}

I don't see any way to control what columns are displayed.
I don't think you can without going into the php code of block.

That block performs a very specific function so no real surprise that its not too flexible.

D-Train said

2) I have added a new catalogue ... After looking at the templates, and trying to go through the tempcode info in the docs, I am baffled on how to go about making these changes.  There does not seem to be any documentation on what templates do what.
Catalogue customisation is covered here ocPortal Tutorial: Designer themes, implementing a clean-room design - ocPortal.com . The video demo at the end of the "Catalogue templating" section walks you through creating a custom template for a specific catalogue.

D-Train said

There also seem to be tempcode in the v9 that is not documented anywhere, such as the !Recent code.
Anything with {!…} is just a language string and is explained in the syntax section in ocPortal Tutorial: Tempcode programming - ocPortal.com

D-Train said

Does anyone have any suggestions on how to make the changes above?  And can anyone point me at any documentation on what templates do what?
Other then the docs I've linked to above, a great way of identifying which templates are actually being used on the current page is to select "Template names as HTML comments (messy)" from the admin tool dropdown list on the bottom-right of the page.


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

Well-settled

Thanks!   :thumbs:

I'll try going through those links tonight after work.
Back to the top
 
Posted
Rating:
#90321
Avatar

I don't see any way to control what columns are displayed.

Edit the catalogue to configure how fields are handled.

You can do it in templating but it requires much more experience/work.

unlike when the Links catalogue is displayed.

The CATALOGUE_links_TABULAR_ENTRY_FIELD template overrides the CATALOGUE_DEFAULT_TABULAR_ENTRY_FIELD template for the catalogue named links. It achieves the linked title via this code:

Code

   {+START,IF,{$EQ,{FIELDID},0}}
      <a target="_blank" title="{$STRIP_TAGS,{VALUE}} {!LINK_NEW_WINDOW}" href="{$GET*,FIELD_1_PLAIN}">{VALUE}</a>
   {+END}

   {+START,IF,{$NEQ,{FIELDID},0}}
      {VALUE}
   {+END}

There does not seem to be any documentation on what templates do what

To find what templates are used, you should use the contextual tools in the page footer.

There also seem to be tempcode in the v9 that is not documented anywhere, such as the !Recent code.

This is a reference to a language string, the syntax will be described somewhere in the Tempcode Programming tutorial.



Ah temp1024 said some of this too, thanks :).


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

Well-settled

Chris,

Thank you very much for the info above.  Editing the Links catalogue to not display the URL column addressed the issue with BLOCK_MAIN_RECENT_CC_ENTRIES.

And once you pointed out the correct template that links uses, I was able to just copy that code into a new template for my new catalogue and it worked perfectly.

I appreciate the quick answers.  Now I just need to go through the references Temp provided and try to actually learn some of this myself.  :)
Back to the top
 
Posted
Rating:
#90385
Avatar

Well-settled

Actually, I spoke too soon.  The change in the Links template worked, but for the new catalogue the titles are displayed as links, but the links basically load the current page in a new window.  

I'll try and play around and see if I can figure it out.
Back to the top
 
Posted
Rating:
#90386
Avatar

Well-settled

Bingo.  I hadn't created copies of all of the other templates for this new catalogue, so I'm guessing some variables weren't fully defined. When I created copies of all 4 templates that are used for the Links catalogue, it seems to work fine.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: