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
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- craigh responded to »Using PageUtil::addVar() to load script code« 03:29 PM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Links for Categories in Content
-
- Rank: Softmore
- Registered: Jul 10, 2006
- Last visit: May 21, 2010
- Posts: 315
-
- Rank: Developer
- Registered: Aug 23, 2003
- Last visit: May 31, 2010
- Posts: 1428
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 -
- Rank: Softmore
- Registered: Sep 13, 2010
- Posts: 105
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
-
- Rank: Developer
- Registered: Aug 23, 2003
- Last visit: May 31, 2010
- Posts: 1428
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
The templates fro the Content newsarticles plugin can be adjusted for that part.
--
campertoday.nl, Module development, Dutch Zikula Community -
- Rank: Softmore
- Registered: Sep 13, 2010
- Posts: 105
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
-
- Rank: Softmore
- Registered: Jul 10, 2006
- Last visit: May 21, 2010
- Posts: 315
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 -
- Rank: Softmore
- Registered: Sep 13, 2010
- Posts: 105
In the News/pntemplates/contenttype/
--
Carl Georg aka Mazdev
Jerindo.net - Ruminations of an Expat in Indonesia & Webdevelopment
-
- Rank: Softmore
- Registered: Jul 10, 2006
- Last visit: May 21, 2010
- Posts: 315
Got it. So how do I make the necessary changes to create links?
--
Christopher Pelletier
NorthumberlandView.ca
A View Like No Other -
- Rank: Softmore
- Registered: Sep 13, 2010
- Posts: 105
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]-->, <!--[/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
-
- Rank: Softmore
- Registered: Jul 10, 2006
- Last visit: May 21, 2010
- Posts: 315
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 -
- Rank: Softmore
- Registered: Sep 13, 2010
- Posts: 105
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
-
- Rank: Softmore
- Registered: Jul 10, 2006
- Last visit: May 21, 2010
- Posts: 315
Well, I tried all that and it still didn't work. Any other suggestions?
--
Christopher Pelletier
NorthumberlandView.ca
A View Like No Other -
- Rank: Developer
- Registered: Aug 23, 2003
- Last visit: May 31, 2010
- Posts: 1428
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 -
- Rank: Softmore
- Registered: Jul 10, 2006
- Last visit: May 21, 2010
- Posts: 315
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 -
- Rank: Developer
- Registered: Aug 23, 2003
- Last visit: May 31, 2010
- Posts: 1428
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
- Moderated by:
- Support
