How to change articles index dropdown list
mishima 145
From: -
From: -
Notice
This topic is archived. New comments cannot be posted and votes cannot be cast.Responses to this topic
1 Re: How to change articles index dropdown list
Philipp Esselbach
From: -
Editor
0From: -
You need to add the following PHP part to the template articles » articles_pages:
Now you can use the variables {$previous} and {$next} in the HTML part for the next/previous page links
global $database;
$query = $database -> dbquery( "SELECT articlepage_page FROM " . DB_PREFIX . "esselbach_ct_articlespages WHERE articlepage_article = '" . $insert[ 'article_id' ] . "' AND articlepage_page < '" . $insert['articlepage_page'] . "' ORDER BY articlepage_page DESC LIMIT 1");
if ($database -> dbrows($query))
{
list($page) = $database -> dbrow($query);
$previous = "<a href=\"contentteller{$insert['param_ext']}{$insert['param_ct']}articles{$insert['param_action']}pages{$insert['param_page']}{$insert['article_seo']},$page.html\">Previous Page</a>";
}
else
{
$previous = "";
}
$query = $database -> dbquery( "SELECT articlepage_page FROM " . DB_PREFIX . "esselbach_ct_articlespages WHERE articlepage_article = '" . $insert[ 'article_id' ] . "' AND articlepage_page > '" . $insert['articlepage_page'] . "' ORDER BY articlepage_page LIMIT 1");
if ($database -> dbrows($query))
{
list($page) = $database -> dbrow($query);
$next = "<a href=\"contentteller{$insert['param_ext']}{$insert['param_ct']}articles{$insert['param_action']}pages{$insert['param_page']}{$insert['article_seo']},$page.html\">Next Page</a>";
}
else
{
$next = "";
}
Now you can use the variables {$previous} and {$next} in the HTML part for the next/previous page links
1 Re: How to change articles index dropdown list
mishima
OP
145
From: -
From: -
Thanks, and how about if I wanted to add NEXT or PREVIOUS page links to the bottom of an article?
1 Re: How to change articles index dropdown list
Philipp Esselbach
From: -
Editor
0From: -
You find it here: articles » articles_layout_pages:
<!-- Template: articles_layout_pages -->
{$insert['articles_pages_header']}
{$insert['articles_pages_pagenav']}
{$insert['articles_pages']}
{$insert['articles_pages_advertisement']}
{$insert['articles_pages_pagenav']}
{$insert['articles_pages_footer']}
1 Re: How to change articles index dropdown list
mishima
OP
145
From: -
From: -
Excellent thanks Philipp, where about can I find where CT puts "5 Pages |1|2|3|4|5" at the top and bottom of an article?
1 Re: How to change articles index dropdown list
Philipp Esselbach
From: -
Editor
0From: -
How do I get it so that it will say the page that I'm actually on rather than "TABLE OF CONTENTS"?
You need to edit the follow template: articles » articles_pages_toc
Add the following PHP part:
$sel = ($insert['articlepage_page'] == $insert['articlepage_toc_page']) ? " selected=\"selected\"" : "" ;
Then replace the HTML part with:
<!-- Template: articles_pages_toc -->
<option value="{$insert['articlepage_toc_page']}"{$sel}>{$insert['articlepage_toc_title']}</option>
Also, just as a side note - is it possible to replicate this drop down menu at the top of the page also? Does it require just copy and paste the code?
You need to edit the articles » articles_pages template and place {$insert['article_toc']} wherever you like.
For example here:
<div class="content">{$insert['article_toc']}{$insert['article_teaserimage']}{$insert['articles_pages_title']}{$insert['articlepage_text']}{$insert['article_toc']}{$insert['article_social']}</div>
Hello,
This is something that kinda bugs me. When you go to the drop down list (TABLE OF CONTENTS) for an article, and select a page the system takes you there but then the drop down list says "TABLE OF CONTENTS".
How do I get it so that it will say the page that I'm actually on rather than "TABLE OF CONTENTS"?
Also, just as a side note - is it possible to replicate this drop down menu at the top of the page also? Does it require just copy and paste the code?
Thanks for your help!