solved Profiles - Assigning different tpl files

MAD
MAD
@madc
11 years ago
600 posts
Is there anyway I can assign a different quota a different default profile page?

I am looking to send users to say a group ( radio quota id=7 ) that has a different layout than normal artists.
In other words I don't want to send them to profile_header.tpl, profile_index.tpl or profile_footer.tpl.

I want to send them to
profile_radio_header.tpl
profile_radio_index.tpl
profile_radio_footer.tpl

With styling of my own design.
I don't want any design from the current TPL files.
I want to redesign the lot.

How would I send their Quota to a different TPL File?




--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 04/23/14 10:23:30PM
SteveX
SteveX
@ultrajam
11 years ago
2,587 posts
In the header index and footer do something like this:
{if $profile_quota_id === 7}
	{jrCore_include template="profile_radio_header.tpl"}
	Or just put the radio quota stuff directly in the template...
{else}
	Normal profile header template stuff...
{/if}



--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
MAD
MAD
@madc
11 years ago
600 posts
You sir are more than a Legend!
Worked perfectly. Now I just need to add more if statements to give our other 4 quotas the same thing.
Be good if you could pick the tpl files you want a quota to use.
BTW your code had === instead of ==
How would I add more to that . Say I had three quotas I wanted to all use separate templates

{if $profile_quota_id == 7}
	{jrCore_include template="profile_radio_header.tpl"}
{else}
{if $profile_quota_id == 9}
       	{jrCore_include template="profile_nextquota_header.tpl"}
{else}
{if $profile_quota_id == 14}
       	{jrCore_include template="profile_id14quota_header.tpl"}
{else}

???


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion
brian
@brian
11 years ago
10,149 posts
triple equals should be used when checking numbers - it checks for both "equals" and same data type.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
11 years ago
10,149 posts
You would use an elseif - i.e.:

{if $profile_quota_id == 7}
	{jrCore_include template="profile_radio_header.tpl"}
{elseif $profile_quota_id == 9}
       	{jrCore_include template="profile_nextquota_header.tpl"}
{elseif $profile_quota_id == 14}
       	{jrCore_include template="profile_id14quota_header.tpl"}
{/if}

http://www.smarty.net/docs/en/language.function.if.tpl

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
MAD
MAD
@madc
11 years ago
600 posts
hmmm === broke the page but == worked ...just saying??


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion
SteveX
SteveX
@ultrajam
11 years ago
2,587 posts
MAD©:
hmmm === broke the page but == worked ...just saying??

Yeah, it was untested code! Got to admit I'm not 100% sure on all of that myself, or how it translates from php to smarty. If something doesn't work first time changing the number of ='s is one of the things I will try.

MAD©:
You sir are more than a Legend!
If you meant the Bob Marley compilation, I am sure I am not (nothing can be more than that stuff). I'm expect you already figured that out anyway when the code didn't work.

But if you meant generic George and Dragon legend type stuff, you might be right. We won't know for sure until I meet up with George again.

Awesome that you met up with Michael! I remember reading it somwhere but don't remember why I didn't comment at the time (British reticence probably). That's the stuff that current legends are made from (not the reticence, the meetup)! Awesome, wish I'd been there as well.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
MAD
MAD
@madc
11 years ago
600 posts
Yeah @michael is a genuine guy and very knowledgable in his coding abilities which pisses me off lol
If anyone gets the chance to hook up with him when he isn't talking about motorbikes or half asleep from three different timezones....do it.
Don't know who george or the dragon are but hey, if they are cool, so are you for providing a quick workaround ;)


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

Tags