Fork me on GitHub

Links for Categories in Content  Bottom

Go to page 1 - 2 [+1]:

  • I am using a Content page as the home page for my site. It shows the latest articles from the News module. I would like people to be able to click on the Category title and go to the specific Category.
    I'm running Zikula 1.2.8.

    --
    Christopher Pelletier
    NorthumberlandView.ca
    A View Like No Other
  • You would have to adjust the template then. If you know where to look you can take the index and article templates and see how it is done there and then copy that stuff to the newsarticles Content template.

    If you cant get it to work let us know

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • In content you can choose as a content type "Module display" and choose then "News" from the modules list. This will put the news Index with the news menu on your homepage.

    --
    Carl Georg aka Mazdev

    Jerindo.net - Ruminations of an Expat in Indonesia & Webdevelopment

  • He already is using that part, but Christopher wants to adjust how that included news looks within Content.
    At least that is what I understood icon_smile The templates fro the Content newsarticles plugin can be adjusted for that part.

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • I know that he uses the News article display plugin in content, but before it where you choose the content type is one called "Module display" this one display the original output of an module.

    --
    Carl Georg aka Mazdev

    Jerindo.net - Ruminations of an Expat in Indonesia & Webdevelopment

  • Hi Erik and Carl,

    Erik is indeed correct. It looks like I am going to need to adjust the templates. I just need to figure out where the templates are located.

    --
    Christopher Pelletier
    NorthumberlandView.ca
    A View Like No Other
  • In the News/pntemplates/contenttype/

    --
    Carl Georg aka Mazdev

    Jerindo.net - Ruminations of an Expat in Indonesia & Webdevelopment

  • Got it. So how do I make the necessary changes to create links?

    --
    Christopher Pelletier
    NorthumberlandView.ca
    A View Like No Other
  • Take a look in the News/pntemplates/news_user_articlecontent.htm or news_user_index.htm

    from the news_user_index.htm

    Code

    <!--[if !empty($info.categories)]-->
            <!--[gt text='Filed under:']-->
            <!--[foreach name='categorylinks' from=$preformat.categories item='categorylink']-->
            <!--[$categorylink]--><!--[if $smarty.foreach.categorylinks.last neq true]-->,&nbsp;<!--[/if]-->
            <!--[/foreach]-->
            <span class="text_separator">|</span>
            <!--[/if]-->



    from the news_user_articlecontent.htm

    Code

    <!--[if !empty($info.categories)]-->
            <!--[gt text='Filed under:']-->
            <!--[foreach name='categorylinks' from=$preformat.categories item='categorylink']-->
            <!--[$categorylink]--><!--[if $smarty.foreach.categorylinks.last neq true]-->, <!--[/if]-->
            <!--[/foreach]-->




    I still don't understand, I'm using content 3.2 and using as contentype "Modules display" it shows the news_user_index.htm including the news menu

    I only choose add new content to page I get the content type selector, choose there Module Display

    choose than at the modules selector news publisher in function and user type fill in user and display and I get the News Index page in my content page and not the Plugin page from the contenttype folder.



    Edited by mazdev on Jan 11, 2012 - 01:00 PM.

    --
    Carl Georg aka Mazdev

    Jerindo.net - Ruminations of an Expat in Indonesia & Webdevelopment

  • That's exactly what I did. What I'd like it to do is make the category names into links to the articles in that category.

    For example, on my site, one of the news categories is "Local News". Right now it's just text but I'd like it to be a link to all of the other articles filed under Local News.

    --
    Christopher Pelletier
    NorthumberlandView.ca
    A View Like No Other
  • Actually the code above is the code for the category links.

    Maybe it doesn't show as the files are in the contenttype directory. You could try to set the link yourself, something like this:

    Code

    <!--[if !empty($info.categories)]-->
            <!--[gt text='Filed under:']-->
            <!--[foreach name='categorylinks' from=$preformat.categories item='categorylink']-->  
            <a href="<!--[pnmodurl modname='News' type='user' func='view' prop=$property.name cat=$category.category.id ]-->"><!--[$categorylink]--></a>    <!--[if $smarty.foreach.categorylinks.last neq true]-->, <!--[/if]-->
            <!--[/foreach]-->
            <span class="text_separator">|</span>
            <!--[/if]-->



    You still could give it a try with the "Module display" contentype instead of the "Recent News Articles" contenttype. That's how I get always my News Index page to display in my Contents Homepage.

    As I don't like the News Menu on the Homepage, I only put then in the news_user_view.htm

    Code

    <!--[if $pagetype neq 'home']-->  
    <!--[nocache]--><!--[include file='news_user_menu.htm']--><!--[/nocache]-->
    <!--[/if]-->




    Edited by mazdev on Jan 11, 2012 - 04:05 PM.

    --
    Carl Georg aka Mazdev

    Jerindo.net - Ruminations of an Expat in Indonesia & Webdevelopment

  • Well, I tried all that and it still didn't work. Any other suggestions?

    --
    Christopher Pelletier
    NorthumberlandView.ca
    A View Like No Other
  • Hi, the templates for the newsarticles plugin for Content is in News/pntemplates/contenttype (so within the News module itself), but you already got that.
    You can add category links by editing News/pntemplates/contenttype/newsarticles_view.html
    This template for Content does not have the preformatted links available in the regular News templates. So you cannot use for instance $links.searchtopic etc.

    In the newsarticles_view.html templates you see at the bottom (in News 262) a line that says"Remove this line to use the topic link and topicimage per News item as below", some code and again such a line. If you remove both lines you enable the category link display if all is right.

    Code

    <!--[* Remove this line to use the topic link and topicimage per News item as below -->
            <!--[if $story.topicsearchurl neq '']-->
            <div class="content_newsarticles_news_meta"><a href="<!--[$story.topicsearchurl]-->"><!--[if $story.topicimage neq '']--><img src="<!--[$catimagepath]--><!--[$story.topicimage]-->" alt="<!--[$story.topicname|pnvarprephtmldisplay]-->" title="<!--[$story.topicname|pnvarprephtmldisplay]-->" /><!--[else]--><!--[$story.topicname|pnvarprephtmldisplay]--><!--[/if]--></a></div>
            <!--[/if]-->
            <!-- Remove this line to use the topic link and topicimage per News item as above *]-->


    --
    campertoday.nl, Module development, Dutch Zikula Community
  • I tried that before and it didn't work. I did try it again and cleared my site cache and still no luck.

    --
    Christopher Pelletier
    NorthumberlandView.ca
    A View Like No Other
  • You do have version 2.6.2 from the ext DB of News. And no templates in other locations, like in your theme or so for this part. Is there anything shown at all from those lines.

    You can add pndebug at the bottom of the newsarticles_view.html template to see what variables are available. Check for the items in the stories array and if topicsearchurl, topic name etc are there.

    --
    campertoday.nl, Module development, Dutch Zikula Community

Go to page 1 - 2 [+1]:

This list is based on users active over the last 60 minutes.