solved jrProfile_disable_sidebar

sekeri
sekeri
@ilker
9 years ago
334 posts
The description for the latest version of Profile Forum is "New: Support added for {jrProfile_disable_sidebar} in templates (as well as header/footer)".

Can you please give more details on {jrProfile_disable_sidebar} ? How can I use it? Can I hide/disable sidebar for a specific profile forum using it, or..?

Thanks..
updated by @ilker: 06/29/15 08:31:24AM
michael
@michael
9 years ago
7,714 posts
There are a few threads on it:
https://www.jamroom.net/the-jamroom-network/forum/new_posts?search_string=Profile_disable_sidebar

To use it, you put it into pages when you don't want to show that that page is part of a profile and it turns the sidebar off.


Like this thread uses it to hide the profile for groups:
https://www.jamroom.net/the-jamroom-network/forum/new_posts/27927/how-to-move-groups-from-profile-pages-to-stand-alone-pages
sekeri
sekeri
@ilker
9 years ago
334 posts
I am using the profile named "Community" to display the general forum of my website. How can I hide profile tabs and left profile sidebar only for this profile? Any easy way of doing this?
douglas
@douglas
9 years ago
2,790 posts
You can check the profile_id and only use that function for that id...

{if $_profile_id == X}
{jrProfile_disable_sidebar}
{/if}

Where X is the id of your community profile.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
sekeri
sekeri
@ilker
9 years ago
334 posts
I have tried it in

modules/jrForum/templates/item_categories.tpl
modules/jrForum/templates/item_detail.tpl
modules/jrForum/templates/item_index.tpl
modules/jrForum/templates/item_list.tpl

and non of it worked. Where exactly should I put it?
michael
@michael
9 years ago
7,714 posts
Do what doug suggested, but first make sure its working before adding the wrapper.

so just add:
{jrProfile_disable_sidebar}
to the locations you have listed, then make sure its working.

Once you have confirmed that it is working, wrap it in the check for the profile id or name.
sekeri
sekeri
@ilker
9 years ago
334 posts
I have added as the first line into the tpl files above and reset the caches but no way :(

Does it work for you?
sekeri
sekeri
@ilker
9 years ago
334 posts
maybe we should add it into one of the jrProfile Module templates instead of jrForum ?
michael
@michael
9 years ago
7,714 posts
Yep, works fine for me.

I add it to the top of:
ACP -> PROFILES -> PROFILE FORUM -> TEMPLATES -> item_index.tpl

make sure that template is 'Active'

Then when I visit a profile's top forum page:
http://my-site.com/admin/forum

The admin's side bar does not show.

--edit--
screenshot
screenshot_no_sidbar.jpg


updated by @michael: 05/14/15 11:51:48PM
sekeri
sekeri
@ilker
9 years ago
334 posts
This is where I add it
Capture1.JPG.jpg
Capture1.JPG.jpg  •  139KB


updated by @ilker: 05/14/15 11:59:25PM
sekeri
sekeri
@ilker
9 years ago
334 posts
Template is active
Capture2.JPG.jpg
Capture2.JPG.jpg  •  73KB


updated by @ilker: 05/15/15 12:00:30AM
sekeri
sekeri
@ilker
9 years ago
334 posts
Here is the result
Capture3.JPG.jpg
Capture3.JPG.jpg  •  139KB


updated by @ilker: 05/15/15 12:02:56AM
sekeri
sekeri
@ilker
9 years ago
334 posts
I am using cloned version of Slate Skin
michael
@michael
9 years ago
7,714 posts
Give it a go one time by changing to the most up-to-date jrElastic. If it does disappear there then the issue is with the skin, if it also has the same behaviour on the most up to date jrElastic, the the issue is elsewhere.
sekeri
sekeri
@ilker
9 years ago
334 posts
Same with all skins.
michael
@michael
9 years ago
7,714 posts
mmm, then the issue appears to be somewhere else. are all modules up to date?

Do you see this code:
    {if $profile_disable_sidebar != 1}
        {jrCore_include template="profile_sidebar.tpl"}
    {/if}
In /skins/YOUR SKIN/profile_header.tpl

??
sekeri
sekeri
@ilker
9 years ago
334 posts
This code is available in original Elastic and cloned Elastic but not in Slate nor cloned Slate.

And
{jrProfile_disable_sidebar}


works in skins/jrElastic/profile_index.tpl

but not in one of the files below;
modules/jrForum/templates/item_categories.tpl
modules/jrForum/templates/item_detail.tpl
modules/jrForum/templates/item_index.tpl
modules/jrForum/templates/item_list.tpl
michael
@michael
9 years ago
7,714 posts
It doesnt need to be in any of those files, add it to your skin and see if that sorts it out.

What it does is sets a flag that is checked for at the point where the sidebar is included. I'll get it added to Slate.

Right now it looks like it only works for:
* Elastic
* Lucid
* Ningja

--edit--
Slate 1.0.8 should now work with {jrProfile_disable_sidebar}

updated by @michael: 05/16/15 01:03:24AM
sekeri
sekeri
@ilker
9 years ago
334 posts
I have updated everything to the latest version.

I don't know so much about Smarty code but when I put the code

{if $profile_id == 1}
    {$profile_disable_sidebar}
{/if}

into the profile_header.tpl it does not work.

But it works when I make it like below
{if $profile_id == 1}
    {$profile_disable_sidebar = 1 }
{/if}

except profile part stays col9 instead of col12 and I have a col3 empty part at the page.
michael
@michael
9 years ago
7,714 posts
Yeah thats not right.

The first section reads "if the value contained in variable $profile_id equals 1 then show the sidebar".

The second reads "if the value contained in variable $profile_id equals 1 then set the value of the variable $profile_disable_sidebar to 1"

If thats what your after then go with that.

Its also very important to know that:
{jrProfile_disable_sidebar}
Is completely different to
{$profile_disable_sidebar}

One is a function, the other is a variable. The first does something, the second contains something.
sekeri
sekeri
@ilker
9 years ago
334 posts
Thank you for the information. I assume that the function
{jrProfile_disable_sidebar}
sets the parameter
{$profile_disable_sidebar}

But it does not work when I add
{jrProfile_disable_sidebar}
into profile_header.tpl

But it works when I add
{$profile_disable_sidebar = 1 }
into profile_header.tpl exactly to the same line.
sekeri
sekeri
@ilker
9 years ago
334 posts
michael:
It doesnt need to be in any of those files, add it to your skin and see if that sorts it out.

Sorry for turning this into a never ending story but can you please tell me where exactly I should place
{jrProfile_disable_sidebar}
in the skin. I have tried many different things but could not make it work properly.
michael
@michael
9 years ago
7,714 posts
Where to place it exactly depends totally on where you want to disable the side bar.

If you want to disable the sidebars when looking at the forum top page, then put it in:
ACP -> PROFILE -> PROFILE FORUM -> TEMPLATES -> item_index.tpl (at the top)

If your doing adjustments via FTP then instead of that location, copy the:
/modules/jrForum/templates/item_index.tpl

to
/skins/( YOUR SKIN )/jrForum_item_index.tpl

So it overrides the default, then put it in the top of that file.

Same thing for any other location you want to turn off. Identify the template that controls that location, set the {jrProfile_disable_sidebar} function in it so it raises a flag to not include the sidebar.
sekeri
sekeri
@ilker
9 years ago
334 posts
I have copied

item_index.tpl
item_categories.tpl
item_detail.tpl

as
/skins/( MY SKIN )/jrForum_item_index.tpl
/skins/( MY SKIN )/jrForum_item_categories.tpl
/skins/( MY SKIN )/jrForum_item_detail.tpl

and it worked.

Actually I thought only one place to insert {jrProfile_disable_sidebar} would be enough.

Thanks!!

Tags