Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Page Number Help
The php snippet along with an article tag using pgonly should get you the results you want.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: Page Number Help
You want me to put <txp:article pgonly="1" /> before the PHP code inside the <title> tags? I just tried that and nothing happens :/
~ Cameron
Offline
Re: Page Number Help
Are you using the same article tag as you are to display the articles? I just added this to my site and it works.
<txp:article limit="6" pgonly="1"/>
<title><txp:page_title /> <txp:php>
global $thispage;
if ( is_array($thispage) ) {
if ( $thispage['pg'] > 1 )
echo 'Page ' . $thispage['pg'];
elseif ( $thispage['numPages'] > 1 )
echo 'Page 1';
}
</txp:php>
</title>
EDIT: this also works for me
<title><txp:article limit="6" pgonly="1"/><txp:page_title /> <txp:php>
global $thispage;
if ( is_array($thispage) ) {
if ( $thispage['pg'] > 1 )
echo 'Page ' . $thispage['pg'];
elseif ( $thispage['numPages'] > 1 )
echo 'Page 1';
}
</txp:php>
</title>
Last edited by MattD (2009-07-08 17:45:00)
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: Page Number Help
Now there’s this plugin as a solution.
<txp:soo_page_count format="Page {current}" />
Doesn’t require the <txp:article pgonly="1" /> tag.
Code is topiary
Offline
Re: Page Number Help
Awesome mate works great. Thank you so much for this awesome plugin.
EDIT: I hate to be a pain :D but I hate the fact that it adds a <span> inside the wraptag. I use a <li> for the wraptag. How would I go about making the active_class add the class to the wraptag? Thanks. (Ive had a look at the PHP but I’ll just end up breaking it)
Last edited by driz (2009-07-08 23:47:26)
~ Cameron
Offline
Re: Page Number Help
driz wrote:
I hate to be a pain :D but I hate the fact that it adds a <span> inside the wraptag. I use a <li> for the wraptag. How would I go about making the active_class add the class to the wraptag? Thanks. (Ive had a look at the PHP but I’ll just end up breaking it)
I’ve answered in the support thread.
Code is topiary
Offline
Re: Page Number Help
Hi, I’m using soo_page_numbers however, I have the following problem, the pagination links 1-2-3-4 >> links generated by the <txp:soo_page_links /> seem to include the full url www.mydomein.com/section/?pg=2
Is there is a way to link them simply to “/?pg=2” so that they also work if our website is loaded via a mirror.
Reason is that we use a mirror version of our site to be accessed by a certain proxy server. This proxy server doesn’t accept our main site (due to problems with our SSL) hence we simply made a mirror at mirror.mydomain.com.
However all pagination links refer not to mirror.mydomein.com/section/?pg=2 but to our main site mydomein.com/section/?pg=2 which makes that you break out of the mirror once you clink on any of the pagination links.
Suggestions anyone?
Offline
Re: Page Number Help
Two ideas:
1) Edit the plugin. Actually it entails editing the library plugin soo_txp_obj or the soo_uri function if you copied that across manually.
At this line, replace:
$this->full = preg_replace('/\/$/', '', hu) . $this->request_uri();
with:
$this->full = $this->request_uri();
so that the domain is not prepended to the links to start with. (If the links lack a preceding slash, you might need to replace it with $this->full = "/" . $this->request_uri(); but I don’t think that is necessary).
2) Search and replace out the domain from the links after the link list has been generated using either rah_replace (txt installer):
<txp:rah_replace from="http://www.mydomain.com" to="">
<!-- your tag -->
</txp:rah_replace>
or smd_wrap:
<txp:smd_wrap transform="replace|string|http://www.mydomain.com|">
<!-- your tag -->
</txp:smd_wrap>
but I’m not sure how well those two perform for whole code blocks.
All untested but hopeful that one or the other or both work.
TXP Builders – finely-crafted code, design and txp
Online