Options

Re-using global HTML/CSS blocks

blackhawxblackhawx Registered Users Posts: 26 Big grins
edited November 12, 2013 in SmugMug Customization
One of the coolest things I like about the new smugmug environment is the ability to drag a CSS or HTML/CSS WYSIWYG block onto the page and place both your custom HTML and CSS into the desired stack order.

What I don't get or even know if possible, is being able to re-use that custom HTML block on other pages. I noticed that I had to re-write the same exact HTML and CSS code block on other pages because the "customize site" menu on the right, did not show me what blocks are on the home page, that I could use on the current "about us" page...Please tell me there is a way to re-use these blocks on other pages this way we are not re-coding the same code across every unique page we have...?

Thanks

Comments

  • Options
    denisegoldbergdenisegoldberg Administrators Posts: 14,273 moderator
    edited November 11, 2013
    You can add a CSS block to your entire site. Or you can put the CSS in your theme. Either of those locations should make the CSS available elsewhere on your site.

    --- Denise
  • Options
    AllenAllen Registered Users Posts: 10,013 Major grins
    edited November 11, 2013
    You'll find the Smug designed this really neat .... NOT! You can add CSS for "homepage", "all folders", "all galleries"
    or "Just this page". Because they have not added CSS flow down page classes there's no way to select sections of your site.
    This was easiely done on legacy for cats or sub-cats.
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • Options
    denisegoldbergdenisegoldberg Administrators Posts: 14,273 moderator
    edited November 11, 2013
    Allen wrote: »
    You can add CSS for "homepage", "all folders", "all galleries"
    or "Just this page".
    You can also add a CSS block to "entire site".
    You're right, you can't code for a specific folder as you could for a category but it is possible to place it on "entire site", don't know if that helps at all.

    --- Denise
  • Options
    AllenAllen Registered Users Posts: 10,013 Major grins
    edited November 11, 2013
    Trouble is you can't target a specific area of your site.
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • Options
    blackhawxblackhawx Registered Users Posts: 26 Big grins
    edited November 12, 2013
    Thanks for the feedback friends. But at the end of the day, it's just "ok" that we can set global CSS rules onto our themes. What would be powerful is to simply "reference" your HTML/CSS blocks onto other pages, this way we're not re-coding large large chunks of custom HTML across multiple pages.

    Referencing these blocks would be awesome. Let's say you had 3 - 5 unique pages that needs a custom menu navigation or a div element with stuff inside, you could then change one of them, and the system would prompt to ask if you want this change applied to the referenced HTML/CSS blocks...That would be hot!!!!


    Thanks again for the feedback
  • Options
    thenickdudethenickdude Registered Users Posts: 1,302 Major grins
    edited November 12, 2013
    You can achieve that effect with HTML code (not CSS) by writing your HTML code as an "article" in an XSS feed which you host offsite, then add a Feeds block to your pages which references that URL. That way, updating your RSS feed updates all the pages that contain that feed block at the same time.

    For example, the "feed" XML file can look like:
    <?xml version="1.0" encoding="UTF-8" ?>
    <rss version="2.0">
    <channel>
      <title>RSS Title</title>
      <description>This is an example of an RSS feed</description>
      <link>http://www.someexamplerssdomain.com/main.html</link>
      <lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000 </lastBuildDate>
      <pubDate>Mon, 06 Sep 2009 16:20:00 +0000 </pubDate>
      <item>
        <title>Example entry</title>
        <description>
        <![CDATA[
    Your HTML code goes here. <p style="color:blue">Test</p>
        ]]>
        </description>
        <link>http://www.wikipedia.org/</link>
        <guid>unique string per item</guid>
        <pubDate>Mon, 06 Sep 2009 16:20:00 +0000 </pubDate>
      </item>
    </channel>
    </rss>
    

    You can host that pretty much wherever you like and then add that as a feed block.
  • Options
    blackhawxblackhawx Registered Users Posts: 26 Big grins
    edited November 12, 2013
    Lamah
    That sounds awesome! Do you know if its possible for us to use google's feed api with the new smugmug system?




    Thanks!
  • Options
    thenickdudethenickdude Registered Users Posts: 1,302 Major grins
    edited November 12, 2013
    I'm not sure what Google's API feed is, sorry. You should be able to achieve this with either any blogging platform that provides RSS feeds and the ability to post arbitrary HTML code, or any webhost that you can upload a simple .xml file to.
  • Options
    blackhawxblackhawx Registered Users Posts: 26 Big grins
    edited November 12, 2013
    Ok, I'll investigate.

    But thank you for the creative idea on my original request!
Sign In or Register to comment.