Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Remove Primary Content Widget Details »»
Remove Primary Content Widget
Version: 1.00, by tommyxv tommyxv is offline
Developer Last Online: Oct 2015 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.x.x Rating:
Released: 08-16-2011 Last Update: Never Installs: 21
Template Edits
Re-useable Code  
No support by the author.

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:
Code:
<vb:if condition="$_GET['r'] == '1-home' OR !$_GET['r']">

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:
Code:
<vb:if condition="$_GET['r'] == '2-docs'">
If you have multiple pages then the line above will look something like this:
Code:
<vb:if condition="$_GET['r'] == '2-docs' OR '3-pagename' OR '4-pagename'">



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)

Code:
<vb:if condition="$_GET['r'] == '1-name_here' OR !$_GET['r']">
<vb:if condition="is_member_of($vbulletin->userinfo, 6)">


{vb:raw css}

	<div class="title" align="right">
	
		<vb:if condition="$can_publish">
				<a href="{vb:raw edit_url}" class="edit"><img class="editimage" src="{vb:stylevar imgdir_cms}/edit_small.png" alt="{vb:rawphrase edit}" /></a>
			</vb:if>
                      </div>


</vb:if>
</vb:if>

<vb:if condition="$_GET['r'] == 'x-name_here'">

{vb:raw css}

	<div class="title">
	<!-- section page title div -->
		<h1 class="header">
			<span>{vb:raw title}</span>
			<vb:if condition="$can_publish">
				<a href="{vb:raw edit_url}" class="edit"><img class="editimage" src="{vb:stylevar imgdir_cms}/edit_small.png" alt="{vb:rawphrase edit}" /></a>
			</vb:if>
			<vb:if condition="$vboptions['externalrss']">
				<a href="external.php?do=rss&amp;type=newcontent&amp;sectionid={vb:raw nodeid}&amp;days=120&amp;count=10"><img src="{vb:stylevar imgdir_misc}/rss_40b.png" alt="{vb:rawphrase rss_feed}" /></a>
			</vb:if>
		</h1>
		<vb:if condition="!$published OR !$setpublish">
			<span style="color:red">
				<vb:if condition="$publishdate AND $setpublish">
					{vb:rawphrase page_will_be_published_x {vb:raw publishdatelocal}} {vb:raw publishtimelocal}
				<vb:else />
					{vb:rawphrase page_not_published}
				</vb:if>
			</span>
		<vb:else if condition="$publishdate" />
			<vb:comment>
				{vb:rawphrase published_on_x {vb:raw publishdatelocal}}  {vb:raw publishtimelocal}
			</vb:comment>
		</vb:if>

	</div>
	<!-- closes section page title div -->
	<vb:if condition="$filter_unpublished_url">
		<a href="{vb:raw filter_unpublished_url}">{vb:rawphrase filter_phrase}</a>
	</vb:if>

	<div id="section_content">
		{vb:raw content}
<vb:comment Removed>
	<vb:if condition="!$no_results_phrase AND $showall">
		<div class="fullwidth">
			<a class="viewall" href="{vb:raw section_list_url}">{vb:rawphrase view_all}</a>
		</div>
	</vb:if>
</vb:comment>
	<hr class="none" />
	</div>

	<vb:if condition="$show['lightbox']">
		<script type="text/javascript" src="clientscript/vbulletin_lightbox.js?v={vb:raw vboptions.simpleversion}"></script>
		<script type="text/javascript">
		<!--
		vBulletin.register_control("vB_Lightbox_Container", "section_content", {vb:raw vboptions.lightboxenabled});
		//-->
		</script>
	</vb:if>

	<vb:if condition="$no_results_phrase">
	<div class="fullwidth">
		<p class="cms_article_txt_content">
			{vb:raw no_results_phrase}
		</p>
	</div>
	</vb:if>

<vb:if condition="$pagenav">
	<div id="below_contentlist" class="fullwidth">
		{vb:raw pagenav}
	</div>
</vb:if>

</vb:if>


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

Was:
Code:
<vb:if condition="is_member_of($bbuserinfo, 6)">
Updated to:
Code:
<vb:if condition="is_member_of($vbulletin->userinfo, 6)">

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

Screenshots

File Type: png screen1.png (3.7 KB, 0 views)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
5 благодарности(ей) от:
alfanexus, Gemma, jeniverre, LOGECT, reddyink

Comments
  #12  
Old 11-03-2011, 06:29 PM
Jokorey Jokorey is offline
 
Join Date: Nov 2011
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Code:
<vb:if condition="$_GET['r'] == '120-change-the-world' OR '121-clients' OR '122-directory' OR '124-news_1' OR '128-human-resources' OR '129-GGOB' OR '130-resources' OR '131-education'">
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?
Reply With Quote
  #13  
Old 11-05-2011, 06:34 PM
GamersChallenge GamersChallenge is offline
 
Join Date: Aug 2011
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jokorey View Post
Hrm, I am having a problem, and not sure what is happening.

Code:
<vb:if condition="$_GET['r'] == '120-change-the-world' OR '121-clients' OR '122-directory' OR '124-news_1' OR '128-human-resources' OR '129-GGOB' OR '130-resources' OR '131-education'">
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.
Reply With Quote
  #14  
Old 11-28-2011, 06:11 PM
Jokorey Jokorey is offline
 
Join Date: Nov 2011
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #15  
Old 12-18-2011, 03:07 PM
GamersChallenge GamersChallenge is offline
 
Join Date: Aug 2011
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #16  
Old 01-06-2012, 12:16 AM
thejohnnybrown thejohnnybrown is offline
 
Join Date: Nov 2011
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
  #17  
Old 02-03-2012, 07:04 AM
tommyxv tommyxv is offline
 
Join Date: Feb 2005
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just did this on a new v4.1.10 install and it is still working for me. Are you still have problems?
Reply With Quote
  #18  
Old 03-27-2012, 07:49 AM
4ibon4ik 4ibon4ik is offline
 
Join Date: Jan 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

4.1.11 my working vbcms_content_section_page template

PHP Code:
<vb:if condition="$_GET['r'] == '1-Home' OR !$_GET['r']">
<
vb:if condition="is_member_of($bbuserinfo, 6)">


{
vb:raw css}

    <
div class="title" align="right">
    
        <
vb:if condition="$can_publish">
                <
a href="{vb:raw edit_url}" class="edit"><img class="editimage" src="{vb:stylevar imgdir_cms}/edit_small.png" alt="{vb:rawphrase edit}" /></a>
            </
vb:if>
                      </
div>


</
vb:if>


<
vb:else if condition="$_GET['r'] > '1-Home'"/>
{
vb:raw css}

    <
div class="title">
    <!-- 
section page title div -->
        <
h1 class="header">
            <
span>{vb:raw title}</span>
            <
vb:if condition="$can_publish">
                <
a href="{vb:raw edit_url}" class="edit"><img class="editimage" src="{vb:stylevar imgdir_cms}/edit_small.png" alt="{vb:rawphrase edit}" /></a>
            </
vb:if>
            <
vb:if condition="$vboptions['externalrss']">
                <
a href="external.php?do=rss&amp;type=newcontent&amp;sectionid={vb:raw nodeid}&amp;days=120&amp;count=10"><img src="{vb:stylevar imgdir_misc}/rss_40b.png" alt="{vb:rawphrase rss_feed}" /></a>
            </
vb:if>
        </
h1>
        <
vb:if condition="!$published OR !$setpublish">
            <
span style="color:red">
                <
vb:if condition="$publishdate AND $setpublish">
                    {
vb:rawphrase page_will_be_published_x {vb:raw publishdatelocal}} {vb:raw publishtimelocal}
                <
vb:else />
                    {
vb:rawphrase page_not_published}
                </
vb:if>
            </
span>
        <
vb:else if condition="$publishdate/>
            <
vb:comment>
                {
vb:rawphrase published_on_x {vb:raw publishdatelocal}}  {vb:raw publishtimelocal}
            </
vb:comment>
        </
vb:if>

    </
div>
    <!-- 
closes section page title div -->
    <
vb:if condition="$filter_unpublished_url">
        <
a href="{vb:raw filter_unpublished_url}">{vb:rawphrase filter_phrase}</a>
    </
vb:if>

    <
div id="section_content">
        {
vb:raw content}
<
vb:comment Removed>
    <
vb:if condition="!$no_results_phrase AND $showall">
        <
div class="fullwidth">
            <
class="viewall" href="{vb:raw section_list_url}">{vb:rawphrase view_all}</a>
        </
div>
    </
vb:if>
</
vb:comment>
    <
hr class="none" />
    </
div>

    <
vb:if condition="$show['lightbox']">
        <
script type="text/javascript" src="clientscript/vbulletin_lightbox.js?v={vb:raw vboptions.simpleversion}"></script>
        <
script type="text/javascript">
        <!--
        
vBulletin.register_control("vB_Lightbox_Container""section_content", {vb:raw vboptions.lightboxenabled});
        
//-->
        
</script>
    </
vb:if>

    <
vb:if condition="$no_results_phrase">
    <
div class="fullwidth">
        <
class="cms_article_txt_content">
            {
vb:raw no_results_phrase}
        </
p>
    </
div>
    </
vb:if>

<
vb:if condition="$pagenav">
    <
div id="below_contentlist" class="fullwidth">
        {
vb:raw pagenav}
    </
div>
</
vb:if>
</
vb:if> 
Reply With Quote
  #19  
Old 05-10-2012, 09:21 AM
Savraj Savraj is offline
 
Join Date: Jan 2012
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi someone tell me how to find the vbcms_content_section_page template...please
Reply With Quote
  #20  
Old 01-21-2013, 10:31 AM
Sherrie Sherrie is offline
 
Join Date: Nov 2005
Location: Adelaide, Australia
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello, is this still an issue in 4.2? I'd hate to think that after moving all of my main pages to the CMS I will now get penalised for cloaking? I looked at the layouts and primary content looks to be the main content of the page? but it doesn't appear to be called a widget?

This is the first time I have used any kind of CMS on my site.
Reply With Quote
  #21  
Old 01-23-2013, 04:17 PM
tommyxv tommyxv is offline
 
Join Date: Feb 2005
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sherrie View Post
Hello, is this still an issue in 4.2? I'd hate to think that after moving all of my main pages to the CMS I will now get penalised for cloaking? I looked at the layouts and primary content looks to be the main content of the page? but it doesn't appear to be called a widget?

This is the first time I have used any kind of CMS on my site.
Yes, you can still use this for 4.2.x
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:49 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08583 seconds
  • Memory Usage 2,390KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (8)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (5)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete