Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Adding elements to panel - where did I go wrong?

So here I am - getting just comfortable enough with theming to become dangerous :) I'm close to having what I want. I decide to try adding some links to the panel. But I don't just want to add links, I want graphics!

Anyway, I add a few things to my default.master.php file (yes - in the theme view folder) and I get them just right with my custom.css. Here's a glance at them on my localhost:

image

When I upload the default.master.php and custom.css files to my live host this is what I see:

image

Below my NavBar/Menu, I have structured a Container with Content and Panel. The text of my additional items is centered in the Panel space as it should be. But the border and background with images are spread across the entire Container space. I have tried assigning the new items different classes and division IDs. Whatever I name them, I can get them to look right with css on my localhost. But it's always the same result at the live host. Any ideas?

Running 2.0.18.8. The plugins that I have running on the live host that aren't enabled on localhost are Facebook, Google Sign In, OpenID and Twitter.

The default.master.php:

image

Comments

  • Options

    @Neo7 said:
    I have tried assigning the new items different classes and division IDs. Whatever I name them, I can get them to look right with css on my localhost. But it's always the same result at the live host. Any ideas?

    I would love to see screenshots of localhost and server. Screenshot of Css of the ... server

    What is in your Container asset? I haven't seen that line in the themes before

    There was an error rendering this rich post.

  • Options

    Think of Container as Row in Vanilla 2.1 and 2.2. Be back shortly with some screenshots.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited September 2013

    Ok , whatever you want to add to the master to get it in the panel put the image link like this.

    <div id="Panel">put the links images whatever here then after that the<?php RenderAsset('Panel');?>

    To add the image links

    <a href="link"><img src="link to image"/></br>text or another link below image</a>

    Also you cant name/class links Box they are not boxes they are content which goes in a box. the .Box is a div

    you could create divs with those classes in the place I said to put them

    <div class="Box 1">
    <a href="link"><img src="link to image"/></br>text or another link below image</a>
    </div>
    
    etc.
    
  • Options

    as @vrijvlinder says

    yes .Box should be a div

    However if you add modules through themehooks this mean their positions are not hard coded in the master view. Little more complicated, something you can think once you have got a bit more advanced,

    vrijvlinder did you mean to put 1 as a class name?

    grep is your friend.

  • Options

    @vrijvlinder said:
    Ok , whatever you want to add to the master to get it in the panel put the image link like this.

    <div id="Panel">put the links images whatever here then after that the<?php RenderAsset('Panel');?>

    Doing this just moved the GuestBox, StartDiscussion button and Categories box to below my new links.

    I also changed the master to the 'correct' Box div.

    I did recall seeing on this forum that table layout is not supported before 2.1 and thought that this might be my problem. So I added width and float statements to the css to match the width and float statements of the Panel. (The value I am using for width is in %) That did the trick on my live host.

    image

    The funny thing is that on my localhost the links are recognized as child of the Panel. And the result is:

    image

  • Options

    Thanks for the responses. Maybe one day I'll be advanced enough to understand why I get different results at my live host than I do at my localhost :D

  • Options
    hgtonighthgtonight ∞ · New Moderator

    Are you running the same codebase on both local and live sites? Have you made any modifications to the source?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    If memory serves, it is same codebase. I have tried to be diligent in uploading any localhost file changes to the live server. I checked the files while attempting to fix this issue and did not see any discrepancies. Which is part of the reason for posting here. To see if someone could point me to a file or set of files to look at more closely. :)

  • Options
    peregrineperegrine MVP
    edited September 2013

    edited out.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited September 2013

    @x00 said:
    vrijvlinder did you mean to put 1 as a class name?

    Well I was too lazy to copy his names he made for those so one or whatever the name he gives them. It was only to point out the .Box div. Don't use digits for class names.

    @Neo7

    I put things in panel and content and anywhere I want , but one must understand the html structure and how to create css rules for them.

    it Helps more to get a link to see the site live. Remember to ad < p > or line breaks in between the links you put so they don't show side by side. And add display:block as a css rule for them.

    You can also sort the order of most modules in the config.php

    If you are using a default.master.php then there are no theme hooks there, all you need to do is add the html.

    You can add it by using php echo or straight html. If you use an existing class like Box, those elements will automatically obtain the Box style.

Sign In or Register to comment.