Bread crumbs navigation

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

Post Reply
ABTOP
Greenhorn
Greenhorn
Posts: 24
Joined: Tue Jul 24, 2007 7:49 pm
Contact:

I am trying to implement the same kind of bread crumbs navigation (plus other shortcuts on the right) as the forum's, except instead of "Index >> Forum >> Topic", I'd like to have "Index >> Quizzes >> Category >> Quiz" and "Index >> Quizzes >> Statistics" and so on. So I copied this navigation portion from my viewtopic_body.tpl with looks like

Code: Select all

<div class="forumline nav-div">
	<p class="nav-header">
		<a href="{U_INDEX}">{L_INDEX}</a> » <a href="{U_VIEW_FORUM}">{FORUM_NAME}</a> » <a href="{U_VIEW_TOPIC}" class="nav-current">{TOPIC_TITLE}</a>
	</p>
	<div class="nav-links">
		<div class="nav-links-left"> 
			{CURRENT_TIME}
		</div> 
		<a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a> | <a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a>
	</div> 
</div>
Then I substituted the Quiz values, shortcuts for Creating a new quiz and for viewing the stats. I came up with

Code: Select all

<div class="forumline nav-div">
	<p class="nav-header">
		<a href="{U_INDEX}">{L_INDEX}</a> » <a href="{L_QUIZZES}" class="nav-current">{L_QUIZZES}</a>
	</p>
	<div class="nav-links">
		<div class="nav-links-left"> 
			<!-- BEGIN switch_user_logged_in --> 
			<a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a><br /> 
			<!-- END switch_user_logged_in --> 
			{CURRENT_TIME} | {S_TIMEZONE} 
		</div> 
		<!-- BEGIN switch_user_logged_in --> 
		{U_SUBMIT_QUIZ}<br /> 
		<!-- END switch_user_logged_in --> 
		{U_STATISTICS_LINK}  
	</div> 
</div>
How ever this works only for the first page.
The other pages, such as this one, are missing all the Quiz's navigational elements.
I am not very versed in php and well be over my head here, thus would greatly appreciate any advice.
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Yeah, that won't work.
You don't necessary need to use PHP for this, you can hard-code the links into the quiz files (all of the quiz files ending in .tpl)
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
ABTOP
Greenhorn
Greenhorn
Posts: 24
Joined: Tue Jul 24, 2007 7:49 pm
Contact:

battye wrote:Yeah, that won't work.
You don't necessary need to use PHP for this, you can hard-code the links into the quiz files (all of the quiz files ending in .tpl)
I guess I didn't quite make myself clear.
When I wrote
"Index >> Quizzes >> Category >> Quiz",
I really meant something like
"Index >> Quizzes >> Category: Such and Such >> Quiz: My very funny quiz".
I can't accomplish that with static links.
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

You can hard code it, just make a couple of alterations.

In quiz_category_body.tpl, use {U_QUIZZES} to display the category name.

I don't have enough time to give you all of the code edits (it would effectively be like writing another MOD) but hopefully this gets you on the right track.

In quiz.php, find

Code: Select all

$template->assign_vars( array(
				 "U_QUIZ_NAME" => $quiz_name,
In the "play" section, and after add something like:

Code: Select all

"U_CATEGORY_NAME" => switch_to_category_name($quiz_category),
And then use {U_CATEGORY_NAME} in the .tpl files in question for category name, {U_QUIZ_NAME} for quiz name.
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
Post Reply