Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrew Blackmore 84 posts 127 karma points
    Mar 01, 2010 @ 22:12
    Andrew Blackmore
    0

    Installing Local Themes

    Hey All,

    I'm developing a set of 7 blogs for my company within umbraco. Everything has gone very well thus far (largely due to the overwhelming support of the umbraco community) but the final issue I am running into is installing the custom themes for each blog. They are all the same but use different style sheets. i don't know how to point them at the style sheets. I would just upload the themes but I know I'm not legally allowed to with the usage contract of some of the artwork so they need to be installed from local packages and I can't find a way to do this.

     

    Any ideas?

  • Donald St. Martin 83 posts 128 karma points
    Mar 11, 2010 @ 17:12
    Donald St. Martin
    0

    Andrew,

    Are you changing the structure of the blog? (editing BlogMaster, Blog, Blogpost and/or Blogpost Textpage)

    --
    Donald

  • Andrew Blackmore 84 posts 127 karma points
    Mar 26, 2010 @ 20:57
    Andrew Blackmore
    0

    Sorry for the delayed response. Yes. Every one of those files has been changed. Maybe just creating new templates is the way to go? As of right now, I have a conditional set up using XSLT that is set to pick the style-sheet based on the section it is in.

      <xsl:template match="/">
        <xsl:variable name="blog" select="$currentPage/ancestor-or-self::node [@nodeTypeAlias= 'Blog']/@id" />
        <xsl:if test="$blog != ''">
          <link rel="stylesheet" href="/css{umbraco.library:NiceUrl($blog)}/style.css" type="text/css" media="screen" />
        </xsl:if>

      </xsl:template>

     

  • Donald St. Martin 83 posts 128 karma points
    Mar 29, 2010 @ 16:26
    Donald St. Martin
    0

    Andrew, I think you are on the right track by creating a new BlogMaster, Blog, Blogpost and/or Blogpost Textpage.  One thing I am doing is changing the skin datatype to a dropdown list.  This keeps the control of the blog's skin in the same place.

    --
    Donald 

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Mar 29, 2010 @ 16:58
    Sebastiaan Janssen
    0

    Yes, I did exactly what Donald suggests. On the top level of the blog, I have a dropdownlist property filled with the filenames of the stylesheets (like blue.css, green.css, red.css, etc).

    In my template I just insert an xslt macro that inserts the stylesheetname and inserts it into the <head> section.

    This is my xslt, I see that I can already improve it by removing the for-each loop, but anyway..:

      <xsl:template match="/">
    
        <xsl:for-each select="$currentPage/ancestor-or-self::node/data[@alias='cssStylesheet']">
          <xsl:if test=". != ''">
            <link rel="stylesheet" type="text/css">
              <xsl:attribute name="href">
                <xsl:text>/css/</xsl:text>
                <xsl:value-of select="."/>
              </xsl:attribute>
            </link>
          </xsl:if>
        </xsl:for-each>
    
      </xsl:template>
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies