PDA

View Full Version : How to remove breadcrumbs from CMS home page


Spyros90
08-12-2015, 11:00 AM
Hello,

This is mi first post here since i couldn't get any help from the .com forum

I have a few questions regarding how to modify my vbulletin5 forum:

1) I would like to remove those annoying breadcrumbs ONLY from the main articles CMS page, any ideas on how to do it?
2) The login bar seems really difficoult to see from the average user, i would like to modify it to make it ALWAS visible, any ways to make this possible?
3) In my main articles CMS page image thumbnails are easily visible but not over the "latest articles sidebar", this is very annoying, do you know any way to fix this?

Hoping someone can help me in this cause i'm really getting mad at all this, thank you for the eventual support :)

Spyros90
08-13-2015, 11:19 AM
Extremely difficoult question i guess?

TheLastSuperman
08-13-2015, 06:17 PM
Edit: Nevermind, apparently this moderator was in the vB5 forum area and NOT paying attention :p. I do not know of a way to do this in vB5 although I found something here (https://vborg.vbsupport.ru/showthread.php?t=313030) that may lead you in the right direction.

IF you had vB4, for reference it would be this;

Create a new plugin:

Product: vBulletin
Hook Location: parse_templates
Title: Hide breadcrumbs on CMS
Execution Order: 5
PHP Code:
if (STYLEID == 1) {
if (THIS_SCRIPT == 'vbcms') {
$cssfix = '<style type="text/css">
#breadcrumb, .breadcrumb {
display:none !important;
}
</style>';
$template_hook[headinclude_bottom_css] .= $cssfix;
}
}

Change the 1 in the STYLEID == 1 to whatever style this is being used in OR remove it altogether to use in all styles, using the code below instead it will remove breadcrumbs on all styles from CMS yet it will not modify mobile at all:

if (!IS_MOBILE_STYLE) {
if (THIS_SCRIPT == 'vbcms') {
$cssfix = '<style type="text/css">
#breadcrumb, .breadcrumb {
display:none !important;
}
</style>';
$template_hook[headinclude_bottom_css] .= $cssfix;
}
}

Better to include this another way as <style type="text/css"> is not "prim and proper" but it will do the trick, the other way would be to make aplugin to generate a new css template then simply hook into the template and ensure it overwrites anything i.e. new css overwrites old css and no messy <style type="text/css"> to deal with but the above will work just fine.

Where did I find this info? How do I know to do these things? Can you learn? ... SURE! Check this out (https://vborg.vbsupport.ru/showthread.php?t=307739) :cool:

Replicant
08-14-2015, 03:10 AM
1, hide breadcrumbs on articles page. Use javascript to check if the page is articles page. You'll need to change the number 14 to the actual channelid of your articles if it is different. 14 is what it is on my system.


<script>
if (pageData.channelid == 14){
$("#breadcrumbs").css("display","none");
}
</script>


for #2, you can mess with this code to get you started. You'll have to play with it to make it work correctly with the responsive code and the "other" floating bar.


#main-navbar, #main-navbar-wrapper {
position: fixed;
z-index: 1500;
}


for #3, a link to the site with a more complete description will help.

Spyros90
08-14-2015, 09:16 AM
Hello and thanks for the replies, i have a few questions:

1) I don't know where i can find this script to hide the breadcrumbs i have a "js" folder in my root/js but there is nothing inside.
2) I probably expressed bad, what i meant about the login bar is that i would like the login form to be always showing up and not hidden
3) The site is this one : www.fantasysportitalia.it, as you can see there are no thumbnails on the "latest articles" section on the sidebar.

Thanks in advance for the replies

Replicant
08-14-2015, 07:55 PM
You're talking about images in the post showing as thumbnails in the Latest Posts? I've not seen that behavior from a search widget. I thought you were talking about the avatars. As far as I know, the search widget isn't designed to show thumbs.

As far as where to add the javascript, you should create a new product and add it there. Here is a tutorial on the subject.
http://www.vbulletin.com/forum/blogs/joe-d/3932614-

Also, I should have asked, if you are on the VB Cloud, you can't create and install mods or edit templates.

Spyros90
08-17-2015, 02:43 PM
Alright man, i got how to enter in debug mode and create a new product and where to hook it, but i don't really get where i should put this

<script>
if (pageData.channelid == 14){
$("#breadcrumbs").css("display","none");
}
</script>

Thanks for the help

Replicant
08-17-2015, 03:41 PM
When you created your new hook, there was a form for a template name.
https://vborg.vbsupport.ru/external/2015/08/8.jpg
The template you created on the create new hook page can be edited in the admincp >> style manger. Select the Master style while in debug mode to apply the code to all styles. Scroll down to the template name and double click it. Paste the code in the template editor and save. Sometimes you will need to clear the system cache in Admincp >> Maintenance for the changes to take effect immediately.

Spyros90
08-18-2015, 10:15 AM
I did it man but the script ain't working :(

www.parliamodipoker.it/file_condivisi/remove.jpg

Replicant
08-18-2015, 12:52 PM
If you right click on the page and view source, is the script there? Is you channelid for Articles 14?

Spyros90
08-18-2015, 01:49 PM
Yes the channel id for articles is 14, i see this but still not working:

www.parliamodipoker.it/file_condivisi/script.jpg

Maybe i have to change the hook position?

Replicant
08-19-2015, 12:17 AM
Ya, that's my fault, I should have told you. Use the footer_before_body_end hook. The reason it's not working is JQuery is not loaded yet at that point of the page.

Spyros90
08-19-2015, 11:03 AM
That worked perfectly man, i appreciate the help!

Now i have this probably bigger issue about the login bar, if you see the login bar in http://www.zyngaplayerforums.com/ you can see how much is easier for the average user to find it.

Have you got any help on what i should do to achieve something similar to this?

Many thanks again

Replicant
08-19-2015, 06:49 PM
The login is a different story. The dropdown is actually an IFRAME linked to "forum base/auth/login". There is javascript involved on the sizing of the container and hiding it until clicked. While it's not impossible to do, it will take some research and experimentation to get the result you are looking for. Optionally, you can put a background around the login text to make it look like a button and stand out.

The default operation already works as it should but the presentation sucks. Personally I think if the user is a guest, the login dialog should be visible at all times but should be hidden as it does now when a user is logged in. It shouldn't be too difficult to chase down the javascript and make up a new script to override the default operation. You should stay away from editing core javascript files as they will be overwritten when you upgrade. Sometimes, it's necessary to edit them in which case you will need to keep track of your changes and reapply them on upgrades. This is actually something I've wanted to implement on my forum but haven't as of yet. I'll get to it in due time.......but don't hold your breath.