Jump to content

hide knowledgebase article but allow non-logged in users to view


sol2010

Recommended Posts

Hello

 

I would like to find some way (code in the template or otherwise) to allow a non-registered user to visit a specific knowledgebase URL (they receive in email etc), but not have that knowledgebase article visible on the site to the public.

 

I've played with all the functions, but can't seem to find a way to do it, except the "Hide" function which then requires users to log in - but the article I want to share will be targeted at non registered users, so I don't want them to log in.

 

More than happy to just add some kind of exclude statement in knowledgebasecat.tpl file - so that I can simply hide it from the category page, but what code would I use? Is their a simple exclude function that I could use in the foreach argument?

 

The category ID is 9 and the article ID is 51. (would prefer top just hide the category if possible)

 

Here is my idea for code from knowledgebasecat.tpl - tested but not working

Any one can help me please?

 


<div class="control-group">

{foreach name=kbasecats from=$kbcats item=kbcat}

{if $kbcat.id ! = "9"}  // added this in but not working

<div class="col4">
       <div class="internalpadding">
           <img src="images/folder.gif" /> <a href="{if $seofriendlyurls}knowledgebase/{$kbcat.id}/{$kbcat.urlfriendlyname}{else}knowledgebase.php?action=displaycat&catid={$kbcat.id}{/if}" class="fontsize2"><strong>{$kbcat.name}</strong></a> ({$kbcat.numarticles})<br />
           {$kbcat.description}
       </div>
   </div>
   {/if} // end of my added in code


{if ($smarty.foreach.kbasecats.index+1) is div by 4}<div class="clear"></div>{/if}
{/foreach}
</div>

Edited by sol2010
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated