Problems with the drop down position
timcs - March 11, 2009 - 08:24
| Project: | Paging |
| Version: | 6.x-1.0-beta3 |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi
I have been trying to get the drop down moved from its original location. I have looked into this $node->paging reference but do not know how to use it or how to move the position of the drop drown box. The theme that I use is pixture reloaded.
Please help
Kind Regards
TimCS

#1
$node->paging is to be printed somewhere in your node.tpl.php like this:
<?phpprint $node->paging;
?>
Wherever it is inserted, the page will appear over there.
#2
Gurpartap Singh
Thank for that, I couldn't see this in any instructions and I tried to find it via the search. I will come back once I have it working so this can be closed.
#3
Right getting there, I think I need to edit the page.tpl.php instead as the node.tpl.php on this template does not give me as much control over where I can put this.
Also is it possible to stop the paging from showing the Next Page link which appears next to the drop down menu?
Kind regards
TimCS
#4
You need to override the theme function, or tell paging to use your custom function for pager type.
For the first approach, copy the theme_paging_drop_down (something like that) function in your template.php.. replace the prefixed "theme_" with "phptemplate_". So, whenever the original function is called, the function in your template.php will be used instead of the original one.
There now you can customize the code/behavior of the drop down and the next/previous links.
#5
Ok, thanks for that, I have kind of achieved this but done in a different fashion. I will look into your suggestion as well.
Kind regards
TimCS
#6
Oh, I'm wondering what you did?
#7
It required remming out areas of the code in the paging.module file. Probably not the best way of doing this as I would like the paging to have a drop down at the top and page navigation at the bottom. Would this required your method to be used or could I still go about this another way?
#8
You are ideally not supposed to edit the module if the required change can be done with other preferable methods. So I had suggest you to override the theme function as suggested above and in the handbooks. This makes sure upgrading to new paging versions is easier :)
#9
I understand what you are saying and I can see the problem but I have spent some time trying to get the right web site software for my site and so Drupal has been the ideal candidate. As I have it working just right would it be a BIG problem (other than the upgrade overwritting it) to keep it this way?. Also would creating the override handle allow for different position as I have the drop down box just where I want it through changing the page.css
I only have one more issue to report which I maybe posting if I cannot figure it out myself. This has been reported under previous versions of this paging routine but I cannot see a current fix for this version. It is to do with TinyMCE and The infamous statement. is okay because I used the custom box to change that to [pagebreak] instead.
Also not really being a huge PHP programer (had help with the previous changes via someone else) I wonder whether I would understand the handbook override guide :-/
#10
All you need to do is copy a theme_X function into template.php and rename it as phptemplate_X, then customize it according to your needs. That's it. I won't affect the $node->paging / position, etc.
Just let me know the issue right here :)
#11
Sorry Gurpartap Singh but that went straight over my head ;). I am more used to GUI programming such as Delphi and I have tried to understand the override part of the handbook and it lost me.
It probably does not help that my brain tends to be tired after my day at work dealing with problems in IT all day :( .
I think I may need a step by step guide to this. There are parts to what I have achieved which I may not have mentioned here so here are my points I need to do (Most I have done through the above alterations in the code but if you prefer I go about it via the override method then here goes):
1) Remove the Next/Previous Page reference that sits to the side of the drop down box (done through editing the code )
2) the drop down box moves over to the top right corner of the page (currently achieve with positioning the $node->paging and editing the page.css to have float : right ; )
3) Would like paging numbers shown at the bottom of the articles page
4) currently the '< !-- pagenames -- >' will not work with TinyMCE as it changes the '< ! ' to lt; (or something like that) if TinyMCE is off then underneath the text area of the HTML code there is the section titled pagenames to change. These disappear when TinyMCE is enabled . So either I would like the '< ! -- pagenames : name -- >' to work or the pagenames box to appear beneath the edit box of the article .
Cheers for any help Gurpartap Singh I appreciate it and I hope I have made some sense :)
Tim CS
#12
Hi again
I have had another look around using your posts regarding changing the drop down function in the themes template.php. There is no function under this name in that php file but there is such a function in the paging.module file that is part of this module. Where do I go from here?
Kind Regads
Tim CS
#13
Yes, you need to copy the function from paging.module file into template.php in your theme's folder. If you are stuck anywhere, join #drupal or #drupal-support on irc.freenode.net network anytime. It'll surely help you finish this up in a few minutes. Try http://mibbit.com/chat/ if you don't have an IRC client yet.
#14
Gurpartap Singh
I have copied this function to the template.php and named it as theme_xpaging_drop_down now when I point the paging module to this function, the drop down box disappears off my content. I have tried entering xpaging_drop_down and xpaging_drop_down() in the custom box with no joy. Any ideas?
#15
ignore my last post, I followed you suggestion of calling it phptemplate_paging_drop_down and took out the references to the calls which made the next/previous page links appear next to the drop down box
My hardest part (or so it seems) is also to make the page numbers or navigations appear at the bottom as well.
#16
print $node->paging in node.tpl.php
It'll print the same kind of pager as you have on the other location. If you want to print a pager of different style, it'll be complex.
#17
Gurpartap Singh
Thanks for the reply , I did ask about this in my earlier post and I had wondered how difficult it would be. I have been thinking about the possibility of either if the paging module could be installed twice under two different names and one could be used for the drop drop and the other for the page numbering.
I did try and install another pager module that does numbering but that conflicted with this one.
#18
Even paging does the number based pagination. You have the option for that in settings. However, if you want to use multiple types of pagers, you'll have to get into the code. May I suggest you to use the paging "block" for name based display? see admin/build/block for it, position the block somewhere inline to your content.
This is interesting request and I'll try to work on improving multiple pager styles requirement/support.
#19
Gurpartap Singh
The idea of showing page numbers and drop down together came from me using Joomla where this was possible as by default Joomla did the page numbering and then I added a drop down box as well.
I will look into your suggestion of using the page block but if it shows Names then this does not sound the same as what I am trying to achieve. I assume from your reply, it isn't possible to load the paging module twice under different references to allow for different paging styles?.
#20
It is possible to show different styles on the same node, though not efficiently. Efficiency in future releases is what I promised above. But I wont be able to help out with it anytime soon.
#21
When you say not "though not efficiently" how would I go about doing this because I have just tried your suggestion with the blocks but it does not suit my needs here. It shows the page name and number, whereas I am after just the number.
Is there anyway of loading the paging module twice?
#22
You don't need to load it twice. Might need to actually hack the paging module's code to implement another pager style into $node->paging_other_style (say). By inefficient I meant, loading paging twice is bad, and hacking it is bad as well, though hacking is the way to go if you need to do it. I'll leave the rest for you to figure out.
#23
Loading it twice may be "bad" but the way things are going I will try anything. As I have said before here, I am no PHP programming so to achieve this would otherwise be extremely hard work.
its sad that a CMS such as drupal lacks this kind of option as it is such a simple idea. Oh well may have to continue looking elsewhere :(
#24
Sorry about my last post, :( I was having a bad day and shouldn't have made such a comment. I am still trying to figure this out and while doing so, I wondered if the following would be easier to do and possible:
At the moment when activating the drop down paging, it displays "Next page" / "previous page on the same line either side of the article. Could these links appear at the bottom of the article leaving the drop down at the top so that I can move the drop down over to the right hand side?
#25
Hi Gurpurtap,
I have to agree with timcs that having the 'previous' and 'next' page links with the drop down box format is overkill. In fact, if you DON'T assign short names to the pages, it uses the full node title PLUS 'page n' and if you are on a middle page where you have BOTH the previous and next links, it gets really ugly. I personally think that if you are using the drop down style, there is no need for the previous and next page links. I'll have to look into the theming modification to fix that.
As for having 2 DIFFERENT styles of pagination on the same page, I don't see the point. It might be nice to have a drop down box on one end of the page and the page number on the other, but if you are using the drop down box, it already shows you the current page anyway.
Thanks for all the neat options in the new paging module. It's a great improvement over the old 5.x.