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.


Restrict certain hyperlink to certain catalogue

Login / Search

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

Fan in action

Restrict certain hyperlink to certain catalogue

  Hi all, i have created a "View All" hyperlink to link to a php page which i have created for retrieving data only from "business_idea" catalogue. I have placed it at site/pages/minimodules_custom and it works. To create a "View All" hyperlink, i have added one line of code

Code

<p class="actions_list_strong"><a href="index.php?page=view_BusinessIdea">View All</a></p>
to the index.tpl

Code

{TITLE}

{+START,IF_NON_EMPTY,{PRE}}
<p>
   {PRE}
</p>
{+END}

{+START,IF_NON_EMPTY,{CONTENT}}
<div class="actions_list">
   {CONTENT}
<p class="actions_list_strong"><a href="index.php?page=view_BusinessIdea">View All</a></p>
<div class="business_page"></div>
</div>
{+END}
{+START,IF_EMPTY,{CONTENT}}
   <p class="nothing_here">
      {!NO_ENTRIES}
   </p>
{+END}

{+START,IF_NON_EMPTY,{POST}}
<p>
   {POST}
</p>
{+END}

  And it happens that if i create another catalogue, the "View All" button still appears and this is what i did not expected. So right now, I'm seeking help to see if anyone knows how to set this hyperlink to appear only if catalogue = 'business_idea' which is ocp2_catalogue.c_name = 'business_idea' (taken from database). Great help is appreciated, thanks in advance
Back to the top
 
Posted
Rating:
#36050
Avatar

Hi,

I think there'll be a parameter in the URL, 'id', that is the catalogue name. You could use Tempcode on this to do a little conditional check:

Code

{+START,IF,{$EQ,{$_GET,id},business_idea}}
<p class="actions_list_strong"><a href="index.php?page=view_BusinessIdea">View All</a></p>
{+END}


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

Fan in action

Thanks Chris, It works.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: