vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=268658

Remove Primary Content Widget
by tommyxv
17 Aug 2011 08:17

1 Attachment(s)
This is for removing the primary content widget from the CMS homepage/index and keeping it only on the pages you desire.

Only Admins will be able to see it on the CMS homepage/index for page setting purposes. Just put your mouse where the primary content box would be and you will see the edit pencil image come up.

Many thanks to Lynne for the help.

You MUST change the variables to the names of your pages.

Examples:

MY SITE URL/content.php?1-home
1-home is my CMS index so I would change 1-name_here to 1-home and the first line would look like:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


MY SITE URL/content.php?2-docs
2-docs is one of my CMS pages so I would change x-name_here to 2-docs and the line would look like:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If you have multiple pages then the line above will look something like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.




1) Find the vbcms_content_section_page template

2) Replace contents with this. (You MUST change the variables to the names of your pages as shown in the examples above)


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.



UPDATED CONDITIONAL STATEMENT TO SHOW THE EDIT PENCIL AGAIN TO ADMINS Tested and working in 4.2.1.

Was:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Updated to:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Please mark 'Installed' if you are using this template edit. I will be happy to help if you are having problems getting it working.

tommyxv 22 Aug 2011 07:04

FYI: This also works in 4.1.5 too.

Wayne Luke 24 Aug 2011 20:55

A couple of changes are needed...

In your first conditional, you need to close the <div> that aligns everything to the right.

In your second conditional, that should be != instead of ==. As written it shows the primary for the one you want to hide it with and doesn't show it on any others.

tommyxv 25 Aug 2011 00:35

Quote:

Originally Posted by Wayne Luke (Post 2237576)
A couple of changes are needed...

In your first conditional, you need to close the <div> that aligns everything to the right.

In your second conditional, that should be != instead of ==. As written it shows the primary for the one you want to hide it with and doesn't show it on any others.

Thanks for the looking at this edit. I added the closing </div>.

I am a little confused with the "!= instead of ==". I tried it but that caused the primary content widget to show on the index to all, and not on my other pages at all. For now I will leave it as is since it is working for me.

I did try using the <vb:elseif condition> and <vb:else /> to make it a bit cleaner, but it did not work.

Wayne Luke 25 Aug 2011 18:23

For the second issue, I guess it depends on what you put for x-name-here. I used my 1-box-office value as that is what my home page is called. So it only showed the primary content on the homepage without showing it elsewhere.

Good job though. Much better than my previous method which was to stick it in a widget area and then use CSS to hide that area.

dbetanco 31 Aug 2011 05:38

no idea about how to use this... sorry my comment.. i'm newbie. where i have to perform this steps???

tommyxv 01 Sep 2011 06:27

Quote:

Originally Posted by dbetanco (Post 2240273)
no idea about how to use this... sorry my comment.. i'm newbie. where i have to perform this steps???


You are replacing the vbcms_content_section_page template with the code I have posted. The text in red are the variables in which you have to change as they are unique to your site.

Link me to your site so I can see your page names and we'll go from there.

pmflav1 21 Sep 2011 13:29

Great stuff thankyou

tommyxv 10 Oct 2011 00:13

Cool, thanks.

Jokorey 03 Nov 2011 16:51

Awesome, thanks!

Jokorey 03 Nov 2011 19:29

Hrm, I am having a problem, and not sure what is happening.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

As soon as I add any "OR 'X'" to the code, the "Primary Content" returns on the 1-home page. If I just have any of the pages listed singular, it's works as expected, hiding the PC on all the other pages that aren't listed.

The end result I am shooting for is to have the PC hidden on 1-home, and visible on all the others. Any ideas?

GamersChallenge 05 Nov 2011 19:34

Quote:

Originally Posted by Jokorey (Post 2264157)
Hrm, I am having a problem, and not sure what is happening.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

As soon as I add any "OR 'X'" to the code, the "Primary Content" returns on the 1-home page. If I just have any of the pages listed singular, it's works as expected, hiding the PC on all the other pages that aren't listed.

The end result I am shooting for is to have the PC hidden on 1-home, and visible on all the others. Any ideas?

I'm having the same problem.

Jokorey 28 Nov 2011 19:11

Gamers - I was never able to get this particular solution to work, but Wayne_Luke's (over on vbulletin.com) is getting the job done for me - might check it out if you haven't.

GamersChallenge 18 Dec 2011 16:07

thanks jokorey, I founded and it works.

so easy, how did I not think of that?

for anyone else looking for this you can find it here, https://www.vbulletin.com/forum/show...-in-a-section?

thejohnnybrown 06 Jan 2012 01:16

If (like me) all you want is to remove the primary content widget from all pages, just do this:

1) Find the vbcms_content_section_page template.

2) Enclose everything in between: <vb:comment> . . . </vb:comment> (comment it all out)


All times are GMT. The time now is 12:56.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.