FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » How to move/replicate elements to another spot on the page (Relative noob to web programming with php - be kind...)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
How to move/replicate elements to another spot on the page [message #166585] Thu, 26 January 2012 02:52 Go to next message
ShineOn is currently offline  ShineOn   United States
Messages: 53
Registered: July 2011
Karma: 1
Member
I would like to know how to move an element of a page to another location, or better still, how to replicate the element to another location on the page. I am still learning the basics of php programming (I know other languages like COBOL, Visual Basic, C++, some other scripting languages, but new to php) so I have no idea how this is done, and am asking your help.

Specifically, I want to place a copy of the pager at the top of each topic thread page, so you don't have to scroll to the bottom to jump to another page in the thread. How can I do that? What do I have to put in what file(s) in the data path so that a template rebuild will make the change take effect? I might be able to do it within the compiled templates and scripts if I can figure out where, but I have no clue (yet) as to the relationship between all the files in the data path /src and /tmpl/ (and other) folders and what has to change where, to make something like this work past the next template rebuild.

I know this much: the pager function, which is used all over the place in FUDforum, is what makes the "pages" navigation links at the bottom of a thread page work, the element which is located above the "rate this topic" and "Goto Forum" elements when in a forum topic thread display. I have no idea which file(s) in the data folder structure need to change in order to replicate it in another location on the page.

I want that same "pages" navigation link element replicated at the top of the thread, preferably under the "tree view", "post topic" and "post reply" buttons, to the left of the addthis icons.

How do I go about replicating that page element and placing it where I want to on the page? What files have to change, how do they have to change, and why, would be the best of all worlds for me. I thank you in advance for indulging this relative noob with his noob question.

[Updated on: Thu, 26 January 2012 02:54]

Report message to a moderator

Re: How to move/replicate elements to another spot on the page [message #166588 is a reply to message #166585] Thu, 26 January 2012 23:49 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3772
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Presentation is controlled by the template files (*.tmpl) in your forum's /thm/theme_name/tmpl/ directory. After each change you need to "rebuild" the theme from the Theme Manager ACP.

Tip: Search for "page_pager" in msg.tmpl.
Re: How to move/replicate elements to another spot on the page [message #166615 is a reply to message #166588] Sat, 28 January 2012 13:40 Go to previous messageGo to next message
ShineOn is currently offline  ShineOn   United States
Messages: 53
Registered: July 2011
Karma: 1
Member
So, somewhere in the several dozen template files, I need to find the template file that controls the presentation of the forum topic list, and somewhere in there locate the element that displays the pages link at the bottom of the topic list page, or perhaps another template which displays the bottom-of-a-list elements for multiple lists including the topic lists, copy that element and modify the copied element so that it displays at the top of the list within that same template file or some other template file also related to presentation of the forum topic list and possibly other lists but which has the top-of-page elements?

I don't suppose the documentation on the wiki extends to a cross-reference of display elements, and/or a cross-reference of templates used within a page or group of like pages...
Re: How to move/replicate elements to another spot on the page [message #166616 is a reply to message #166615] Sat, 28 January 2012 16:30 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3772
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
It's easy to find. The template name is in the URL. Look for t=???. This page, for example is generated from msg.tmpl.
Re: How to move/replicate elements to another spot on the page [message #166626 is a reply to message #166616] Tue, 31 January 2012 02:11 Go to previous messageGo to next message
ShineOn is currently offline  ShineOn   United States
Messages: 53
Registered: July 2011
Karma: 1
Member
but isn't the pager generated from the draw_pager.tmpl which is included in the thread.tmpl (and others?)

I am trying to figure out where the code is that says where the pager gets positioned. If I knew that, I figured maybe I could determine how to add it in another position on the page (not move it, but have it display top and bottom...) but I guess I don't know what I'm looking for looks like to get that starting point.
Re: How to move/replicate elements to another spot on the page [message #166627 is a reply to message #166626] Tue, 31 January 2012 02:58 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3772
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Edit thread.tmpl and move {TEMPLATE-DATA: page_pager} to where you want it, or replicate it to display as many times as you like.

The page_pager variable is created from draw_pager.tmpl in the corresponding file in the forum's /src directory.
Re: How to move/replicate elements to another spot on the page [message #166654 is a reply to message #166627] Mon, 06 February 2012 00:19 Go to previous messageGo to next message
ShineOn is currently offline  ShineOn   United States
Messages: 53
Registered: July 2011
Karma: 1
Member
I tried, but it isn't showing up. Yes I did a rebuild themes...

Tried a couple different ways. Could it be because I am using the path_info template? The threads.tmpl in path_info looks like it modifies the default threads.tmpl, and I wonder if I am missing something.
Re: How to move/replicate elements to another spot on the page [message #166657 is a reply to message #166654] Mon, 06 February 2012 04:12 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3772
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Thread.tmpl in PATH_INFO overrides some of the definitions of thread.tmpl in DEFAULT. Mainly to change the URL's, but definitely not the layout.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Dynamic check of login/alias/email availability
Next Topic: fud_update_user, fud_add_user patch
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Dec 22 01:07:17 GMT 2024

Total time taken to generate the page: 0.04472 seconds