tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/16651-creating-customized-css-in-style-drop-down-for-just-one-site-in-addition-to-global-cssCascade CMS: Discussion 2018-10-18T20:37:28Ztag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-02T18:43:07Z2015-03-02T18:43:07ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>We'd like to be able to create some customized classes for a
particular site so that the web content editor can have those
choices in the drop down, in addition to the choices that are in
the global.css file.</p>
<p>I know we can add styles right in the page, but we'd rather add
it at site level and I understand we can assign a style sheet just
for a single site. Once we do that, then those customized styles
are all that shows in the drop down. How do we also pull in the
global css styles in addition to the customized styles?</p></div>Barbara Seatontag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-02T18:46:12Z2015-03-02T18:46:12ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Hi Barbara,</p>
<p>I believe once you add the custom styles at the Site level, they
will overwrite your Global styles. The only way around this would
be to copy your Global styles into the Site styles as well.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-02T19:11:28Z2015-03-02T19:11:28ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Could you not use @import to pull in another style sheet? Would
it need to be a style sheet other than the global.css that gets
imported?</p></div>Barbara Seatontag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-02T19:49:55Z2015-03-02T19:49:55ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Hi Barbara,</p>
<p>I do not think it will be possible to use an
<code>@import</code> in this case, because the asset is within the
Global area and it is not possible to link from Site to Global.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-02T20:30:30Z2015-03-02T20:30:30ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Could I create another style sheet that sits in root that could
be imported into a site stylesheet?</p>
<p>I tried it and could not get it to work, so thought I might be
missing something.</p></div>Barbara Seatontag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-02T20:49:16Z2015-03-02T20:49:16ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Hi Barbara,</p>
<blockquote>
<p>Could I create another style sheet that sits in root that could
be imported into a site stylesheet?</p>
</blockquote>
<p>I am not sure if I am understanding your question. When you sat
<em>root</em>, are you referring to the Base Folder of your Site, a
different Site, or the Global area?</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-02T21:12:19Z2015-03-02T21:12:19ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Hey Ryan,</p>
<p>Sorry for the confusion! When I refer to root, it is the root of
our entire web site, where our home page (index.php) sits for
ung.edu. So actually, it is a different site in Cascade.</p></div>Barbara Seatontag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-02T21:21:40Z2015-03-02T21:21:40ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Not a problem at all, Barbara, thank you for clarifying.</p>
<p>I believe you should be able to accomplish this; assuming you
are linking from one Site to another Site. In that case, you should
be able to do something like the following:</p>
<pre>
<code>@import('[system-asset]site://SITENAME/path/to/styles.css[/system-asset]');</code>
</pre>
<p>Where <code>SITENAME</code> would be the Site in which the CSS
file you wish to import is located, and
<code>path/to/styles.css</code> would be the actual path and file
name of the CSS file you want to import.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-02T21:42:51Z2015-03-02T21:42:51ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Okay, I created a file in our "_root" site at
"_uploads/css/ung/editor.css". I copied the styles from global.css
into this file.</p>
<p>Then I created a file in the actual site, "web-toolbox", at
"_uploads/css/edit.css". I added the following statement:<br>
@import('[system-asset]<a>site://_root/_uploads/css/ung/editor.css[/system-asset]&#39</a>;);</p>
<p>At this moment, it is the first and only line in the file.</p>
<p>Then I went to Site Management and found the "web-toolbox" site.
I edited it and assigned "_uploads/css/edit.css" as the CSS
file.</p>
<p>The result: It shows nothing in the style drop-down when I edit
a page in the "web-toolbox" site.</p>
<p>I noticed in the Site Management that there is a field for CSS
Classes. Do we have to fill that in as well? Or can we just assign
the css file?</p></div>Barbara Seatontag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-02T22:29:20Z2015-03-02T22:29:20ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Hi Barbara, yes, you'll need to specify which particular classes
are exposed to the editor. Can you give that a shot and see if it
works for you?</p></div>Bradley Wagnertag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-02T22:34:19Z2015-03-02T22:34:19ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Hello Bradley,</p>
<p>Yes, that does work. Unfortunately, it's not what we need. I was
hoping for a central css file, with additional local css classes in
a specific site. Having to add those classes in that field defeats
pulling in a central css file via @import.</p>
<p>But thanks guys for all your help!</p></div>Barbara Seatontag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-02T22:40:45Z2015-03-02T22:40:45ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Hi Barbara,</p>
<p>Would it make sense to scrip the insertion/update of those CSS
classes using our web services API?</p>
<p>We're also re-working our editor controls a bit for our Cascade
8 so that's something for us to keep in mind.</p>
<p>Can you describe your desired behavior for this CSS and what
specifically should show up in the WYSIWYG's style dropdown?</p></div>Bradley Wagnertag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-03T13:36:27Z2015-03-03T13:36:27ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Hey Bradley,</p>
<p>Sometimes we are asked to develop some specific styling in the
content areas of specific sites. We'd like our web editors who
maintain those particular sites to be able to use the classes we
provided for those styles, but we don't want these classes
available globally. If we had a way to provide classes in addition
to the global classes in the style drop-down just for a particular
site, that would be a great help.</p>
<p>Here is what we think we're wanting:</p>
<p>A central css file for the WYSIWYG editor that contains all the
styles we want our editors to have access to in the style
drop-down. The available classes would be maintained in this one
file (just like global.css works now).</p>
<p>A local css file for a specific site where we can provide
customized classes in the style drop-down in the WYSIWYG in
addition to the "global" styles.</p>
<p>So a particular site would have both global and site-specific
styles listed in the style drop-down field in the WYSIWYG
editor.</p></div>Barbara Seatontag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-03T18:48:13Z2015-03-03T18:48:13ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Hi Barbara,</p>
<p>If i'm following you correctly, you could accomplish this but it
would be a little cumbersome in terms of specifying the
classes.</p>
<p>You'd have:</p>
<ul>
<li>A system-wide CSS file that is stored in a shared site</li>
<li>A site-specific CSS file that imports the system-wide CSS in
its first line and then specifies any site-specific styles
thereafter</li>
<li>The Site's CSS classes would contain all of the global classes
plus any classes that are only in the site-specific style.</li>
</ul>
<p>Does that make sense? Am I missing anything? Do your local
styles ever overwrite your global ones or do they merely supplement
them?</p>
<p>The only real obstacle as I mentioned is that the CSS Classes
would need to contain both sets of classes and would need to either
be manually maintained or updated via web services.</p>
<p>Let me know if that makes sense and thanks for helping us
understand your desired set-up.</p></div>Bradley Wagnertag:help-archives.hannonhill.com,2010-02-09:Comment/361766652015-03-03T20:41:25Z2015-03-03T20:41:25ZCreating customized css in style drop down for just one site (in addition to global css)<div><p>Hey Bradley,</p>
<p>Yes, you have it correct. The only drawback is listing all the
classes in the CSS Classes field. It would be nice to not have to
list the classes in that field but would be automated the way the
standalone global one is now.</p>
<p>Having an option in the Site Management panel to choose a
combination of css files would be super. Such as: Listed fields
only, global only, global and local, or local only.</p>
<p>Our local styles usually supplement the global ones.</p>
<p>Thanks!</p></div>Barbara Seaton