[Solved] Is there a list of actions vs templates?

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
User avatar
Gumboots
Registered User
Posts: 801
Joined: Fri Oct 11, 2019 1:59 am

[Solved] Is there a list of actions vs templates?

Post by Gumboots »

I'm after a list of which actions (or sections) correlate to which templates in Prosilver.

For example, ?search_id=unreadposts renders its results in search_results.html. However, if you run a search within a forum, then that action renders its results in a different format (as individual posts) and does it in a mysterious template currently unknown to me.

So if there's a handy list of what leads to which template somewhere, that would be really cool.
Does such a thing exist?
Last edited by Gumboots on Mon Nov 11, 2019 2:35 pm, edited 1 time in total.
🇺🇦 Слава Україні! 🇺🇦 Героям слава! 🇺🇦
User avatar
EA117
Registered User
Posts: 2173
Joined: Wed Aug 15, 2018 3:23 am

Re: Is there a list of actions vs templates?

Post by EA117 »

Not aware of such a list, which isn't to say one doesn't exist.

My presumption would have been you're looking at the search_results.html template in both cases, but seeing the difference of the <!-- IF S_SHOW_TOPICS --> logic contained within that single template.

If there actually was another template involved, the way to find it would be looking in search.php to see what alternative template it conditionally assigns, instead of search_results.html. i.e. There would be more than one $template->set_filenames() call made under different conditions; or there would be a single $template->set_filenames() call but using a variable that was conditionally set to a different filename.
User avatar
Gumboots
Registered User
Posts: 801
Joined: Fri Oct 11, 2019 1:59 am

Re: Is there a list of actions vs templates?

Post by Gumboots »

EA117 wrote: Mon Nov 11, 2019 12:48 am Not aware of such a list, which isn't to say one doesn't exist.
It would be a nifty thing to have. I might have to trundle over to Area 51 and suggest it. I did try the docs, but no joy.
My presumption would have been you're looking at the search_results.html template in both cases, but seeing the difference of the <!-- IF S_SHOW_TOPICS --> logic contained within that single template.
Doesn't seem to be, as I can't find any markup in that file that matches what is rendered.

ETA: Hang on. Found it. D'oh. The dodgey indentation was throwing me off the scent. I hate dodgey indentation (really).
If there actually was another template involved, the way to find it would be looking in search.php to see what alternative template it conditionally assigns, instead of search_results.html. i.e. There would be more than one $template->set_filenames() call made under different conditions; or there would be a single $template->set_filenames() call but using a variable that was conditionally set to a different filename.
Righty-o then. Off to sources I go. *grabs shovel*
🇺🇦 Слава Україні! 🇺🇦 Героям слава! 🇺🇦
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6432
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Is there a list of actions vs templates?

Post by thecoalman »

Gumboots wrote: Sun Nov 10, 2019 11:41 pm I'm after a list of which actions (or sections) correlate to which templates in Prosilver.
If you look in includes/functions.php you'll find this array at the bottom, this is just the start of it:

Code: Select all

	// The following assigns all _common_ variables that may be used at any point in a template.
	$template->assign_vars(array(
		'SITENAME'						=> $config['sitename'],
		'SITE_DESCRIPTION'				=> $config['site_desc'],
You will also find an array the bottom of each main PHP file like search.php that contains similar array. Note the last one, you now have switch which can be used in templates to turn on or off something when in search.

Code: Select all

$template->assign_vars(array(
	'S_SEARCH_ACTION'		=> append_sid("{$phpbb_root_path}search.$phpEx", false, true, 0), // We force no ?sid= appending by using 0
	'S_HIDDEN_FIELDS'		=> build_hidden_fields($s_hidden_fields),
	'S_CHARACTER_OPTIONS'	=> $s_characters,
	'S_FORUM_OPTIONS'		=> $s_forums,
	'S_SELECT_SORT_DIR'		=> $s_sort_dir,
	'S_SELECT_SORT_KEY'		=> $s_sort_key,
	'S_SELECT_SORT_DAYS'	=> $s_limit_days,
	'S_IN_SEARCH'			=> true,
));


When you have something like topics, posts or search results being displayed it's an array in a loop. There is template variable all over the place... Easiest way to track them down is search the files for the template variable using the search function on editor like Notepadd++ that allows you to search directories and sub directories.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
Gumboots
Registered User
Posts: 801
Joined: Fri Oct 11, 2019 1:59 am

Re: Is there a list of actions vs templates?

Post by Gumboots »

Not quite what I was after. I was thinking of a list of GUI url's vs which template renders the result.

So, as an example:

Code: Select all

index.php - forumlist_body.html
viewforum.php? - viewforum_body.html
Etc,
etc.
But yes, I can run recursive searches on template variables. I was hoping to avoid that. :lol:
🇺🇦 Слава Україні! 🇺🇦 Героям слава! 🇺🇦
User avatar
Talk19Zehn
Registered User
Posts: 912
Joined: Tue Aug 09, 2011 1:10 pm

Re: Is there a list of actions vs templates?

Post by Talk19Zehn »

Hi, ... take a look. Perhaps helps the cross reference

https://www.phpbb.de/xref/3.2/nav.html?index.html

Regards
User avatar
pit-PL
Registered User
Posts: 3212
Joined: Sat Nov 21, 2009 12:24 pm

Re: Is there a list of actions vs templates?

Post by pit-PL »

User avatar
Gumboots
Registered User
Posts: 801
Joined: Fri Oct 11, 2019 1:59 am

Re: Is there a list of actions vs templates?

Post by Gumboots »

Cool. That'll do.Thanks.
Talk19Zehn wrote: Mon Nov 11, 2019 11:09 amHi, ... take a look. Perhaps helps the cross reference
Thanks for the link, but the other one is more idiot-proof. ;)
🇺🇦 Слава Україні! 🇺🇦 Героям слава! 🇺🇦

Return to “[3.2.x] Styles Support & Discussion”