Previous page: link at the end of some articles

  • elanna
    Inactive member
  • Topic Author
  • Member
  • Member
More
12 years 5 months ago #12798 by elanna
See the image about JCE Editor parameters I have set:
Attachments:

Please Log in to join the conversation.

More
12 years 5 months ago #12814 by ivan.milic
Well also you can go around that problem, and maybe even better solution:
in HTML:

<a href="javascript:;" class="PrevPageNav">
<strong>&lt;Previous page</strong>
</a>

then add this to end of head section of index.php of template(before </head>):

<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('a.PrevPageNav').click(function(){
location.href = document.referrer;
});
});
</script>

this script will turn every <a> on page having class :PrevPageNav into link to previous page.

Please Log in to join the conversation.

  • elanna
    Inactive member
  • Topic Author
  • Member
  • Member
More
12 years 5 months ago #12842 by elanna
Great! Now, it is working!

The frase "Previous page" is not shown as a link (blue font, as the others into the template), but I think it's not a big deal.

If I click on that frase, the navigation back to previous page as expected.

Tks.

Please Log in to join the conversation.

More
12 years 5 months ago #12859 by ivan.milic
Put # instead of JavaScript:; so color becomes same, but check compatibility in all browsers after that.
The following user(s) said Thank You: elanna

Please Log in to join the conversation.

  • elanna
    Inactive member
  • Topic Author
  • Member
  • Member
More
12 years 5 months ago - 12 years 5 months ago #12864 by elanna
Now, its PERFECT!!! Tanks a lot!

Lets share the complete instructions with this community:

To place a "Previous Page" link at the end of your articles as as additional navigation feature to FAQ and News, either other category list articles, follow this steps:
_______________________________________________________________
Template tested: Hot Software Template
System versions: JQuery 1.7.1; Joomla 1.7.2; JCE Editor 2.0.19
Tested browsers: FireFox8, IE8 and IE9

1.) Add this to end of head section of index.php of template(before </head>):

<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('a.PrevPageNav').click(function(){
location.href = document.referrer;
});
});
</script>

This script will turn every <a> on page having class :PrevPageNav into link to previous page.

2.) Then, place this HTML command line at the end of your article:

<p><a href="#" class="PrevPageNav"><strong>&lt;-Previous Page</strong></a></p>
Last edit: 12 years 5 months ago by elanna. Reason: reorganizing instructions order...

Please Log in to join the conversation.

  • elanna
    Inactive member
  • Topic Author
  • Member
  • Member
More
12 years 4 months ago - 12 years 4 months ago #13217 by elanna
Just sharing an alternative with this community...

It is a solution for javascript stripped from articles, after saving changes, like that javascript command to "previous page" I tryed when started this topic.

Please see - www.joomlacontenteditor.net/support/faq/...ts-removed-on-saving

I can be usefull for users who doesn't wanna include that JQuery parameters in index.php file...

Finally, if you are looking for a breeze in you project, with no complex steps...you can just use this Plugin:
extensions.joomla.org/extensions/structu...site-navigation/4583
Last edit: 12 years 4 months ago by elanna.

Please Log in to join the conversation.

Time to create page: 0.348 seconds
Powered by Kunena Forum