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.


Stupid question on customizing the download list template :)

Login / Search

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

Community saint

Hi, I've been designing a theme for my website for a few weeks, and so far I am amazed about how deep ocportal's customization can go.

Now I'm trying to make a download's rate show on the listing, but I can't find that piece of code for the rating's output :(

This is how my DOWNLOAD_0.tpl looks so far:
(Made so the date and hits will show on the right)

Code

<ul class="download_0">
   <li>
      <div style="float: left">
      <a href="{URL*}">{+START,FRACTIONAL_EDITABLE,{NAME},name,_SEARCH:cms_downloads:type=__ed:id={ID}}{NAME*}{+END}</a>
      </div>
      <div style="float: right">
      <span class="associated_details">{!ADDED,{DATE*}} | {!DOWNLOADS_SO_FAR,{DOWNLOADS*}}</span>
      </div>
   </li>
</ul>
  Now this is the code trying to have the rating in the date's place:
<ul class="download_0">
   <li>
      <div style="float: left">
      <a href="{URL*}">{+START,FRACTIONAL_EDITABLE,{NAME},name,_SEARC
H:cms_downloads:type=__ed:id={ID}}{NAME*}{+END}</a>
      </div>
      <div style="float: right">
      <span class="associated_details">{RATING*} | {!DOWNLOADS_SO_FAR,{DOWNLOADS*}}</span>
      </div>
   </li>
</ul>
  With this error msg at the top:
A parameter, RATING, is referenced in the template, DOWNLOAD_0, but not passed

I've tried a few other {code} that I could find scattered around the theme with no success. :puppyeyes:

Thanks in advance for anyone that can help me ;)

Back to the top
 
Posted
Rating:
#37849
Avatar

Hi,

Sorry, but this isn't possible with just templating - it'd need code changes, as 'RATING' is only generated on the download-view screen.


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

If you're reasonably comfortable with PHP you won't find it very difficult to change. Just look for do_template('YOUR_TEMPLATE_NAME' in the code, and you can see exactly which paramaters are being passed in to each one.

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

Quick reply   Contract

Your name:
Your message: