Closed (fixed)
Project:
E-Journal
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2008 at 07:00 UTC
Updated:
28 Jul 2008 at 10:59 UTC
Hi,
how can I add 3 links at bottom of an article that allow to go back to index of issue, go to previous article and next article?
Especially a back to index should be great...
I don't think is difficult but I don't know php, so if someone can tell me what modify and where...
Thanks.
Comments
Comment #1
romca commentedHi,
you should use the standard Drupal's themeing
see:
http://drupal.org/node/46012
and especially:
(if you want to theme journal specific pages, ie those with /ejournal - you can do so in you custom template, look at the theme_ikaros.inc for examples)
if you have node-type "articles", create "articles-node.tpl" inside of you theme folder
look at node.tpl, copy it to the new file and add this snippet to the appropriate place (not tested):
Comment #2
drein commentedHi,
I create a custom theme for ejournal, called theme_test.inc, I pasted your snippets there and I activated that layout.
I had 2 3 syntax error, anyway I think having corrected them, but I can't see any "previous, next" link when reading an article, I'm sorry.
could you read this code and tell me if there is something wrong?
Comment #3
drein commentedok, I'm a stupid, it's clear that this snippet must be copied into a real file, like your theme or a node.template.tpl, not be alone!
ok, I'll give a try tormorrow.
Comment #4
drein commentedHmmmmm.
There are errors in the php scripts, so I can't know how to figure out. I copied the snippets to node-mytypeofcontents.tpl.php, and effectively now there is "issue" link displayed.
but this link, that should return to index, give a page not found, its path is something like:
www.mysite.com/i/i/i/i/i
and the php line is this:
print l(t("Issue Ritorna all'indice di questa edizione"), ejournal_path_set('iid', $node->ejournal->journal->iid));
I don't know why but unfortunately, the previous and next article doesn't appear.
Comment #5
romca commentedok,the good thing is that now we know the theme is called and the ejournal data is there
please find some of the lines and replace them with this:
and
if it still does not work, then use this to debug, see if we got articles, if there is the issue etc
Comment #6
drein commentedyeaaaah! it works at 99%!
great, now we have previous and next article working well. the only thing is that the "back to index" brings to the "ejournal" index of all the journals, not to the index of current issue.
the path is something like:
www.mysite.com/ejournal/show/_/_/4
I think it's the last thing, anyway I'm very happy just so.
Comment #7
romca commentedoh yeeah, i forgot to pass the journal-id
do this:
the link sohould be: www.mysite.com/ejournal/show/1/_/4
Comment #8
drein commentedOk!
that's right, now all is working well.
for other people that in future will read this topic, I post all the snippet:
if someone has problem with "" , replace with '' .
Thanks again.
Comment #9
drein commentedSorry, a question if you can help me:
the snippet is really ok, there is only a problem:
when you are in the archive page and select a category for seeing articles about that, I can view all the list of articles but, there are also the link "previous, next, , and back to index" for each article and I'd like to remove them from there, it is too much redoundant...
have you any ideas how to remove these links?
Comment #10
romca commentedif you theme only a certain node-type, then the links will display only for those node-types
something like node-article.tpl.php
you should not have the snippet in the general theme because then it gets applied to every page (which does not have its own themeing function)
Comment #11
drein commentedyes in fact.
The problem is just here, I have the snippet in a node-article.tpl... not in the general node or in the ejournal standard theme...
this is the strange thing!
mmm, but, when I am in the list of articles of a category, each article has 5 6 lines of text, then the button "read all".
do you think that the teaser recalls the node-article.tpl?