Show If

Has anyone used a show if for simple edit to include a linked CSS file?


So the simple edit css only gets loaded while in simple edit.



prefer to have single source css, rather than a child file with every design

Depending on what you want to customise (and assuming you're not concerned about loading all your css in one go), a simpiler solution may be to wrap a div around each of your simple edit layouts, then style accordingly.


eg.:

    div.simple-edit input { color: hotPink; }


This will allow you to customise everything inside the form, but not the form itself.

[quote]Depending on what you want to customise (and assuming you're not concerned about loading all your css in one go), a simpiler solution may be to wrap a div around each of your simple edit layouts, then style accordingly.


eg.:

    div.simple-edit input { color: hotPink; }


This will allow you to customise everything inside the form, but not the form itself.
[right][post="12208"]<{POST_SNAPBACK}>[/post][/right][/quote]
No planned on using a single css to apply to simple edit for all sites.. one fits all approach....

so was hoping to pull in a css design asset, only if in simple edit mode if possible, to reduce load times if not required.

[quote]so was hoping to pull in a css design asset, only if in simple edit mode if possible, to reduce load times if not required.
[right][post=“12209”]<{POST_SNAPBACK}>[/post][/right][/quote]



You certainly can do this:


    
       
       
          
       
    


That <link> line will only be printed when you're in Simple Edit.

[quote]You certainly can do this:

    
       
       
          
       
    


That <link> line will only be printed when you're in Simple Edit.
[right][post="12210"]<{POST_SNAPBACK}>[/post][/right][/quote]

Yeah but that assumes the css is a direct child of the current design.. I was hopinh to take it one step further and used an actual css asset.... like you would normally do when creating a linked css design area.

[quote]Yeah but that assumes the css is a direct child of the current design… I was hopinh to take it one step further and used an actual css asset… like you would normally do when creating a linked css design area.
[right][post=“12211”]<{POST_SNAPBACK}>[/post][/right][/quote]



If you want the CSS to be at some no related location you need to get the actual filename (__data ) for the asset.



eg:


    
        
        
        
            @import url(http://sitename/__data/assets/file/531503/toolbox.css);
        
    


You can get the __data name by making the CSS asset file cached, going to the dependants page for the file, and looking for a filename with the same name as the CSS asset but a different asset number.

You can build the filename from the id:

/__data/assets/file/ID/FILENAME


cheers
RIchard

[quote]Yeah but that assumes the css is a direct child of the current design… I was hopinh to take it one step further and used an actual css asset… like you would normally do when creating a linked css design area.
[right][post=“12211”]<{POST_SNAPBACK}>[/post][/right][/quote]



If you are using a linked CSS design area in your design already, then you should be able to place that inside the MySource_THEN tag instead.

[quote]If you are using a linked CSS design area in your design already, then you should be able to place that inside the MySource_THEN tag instead.
[right][post=“12213”]<{POST_SNAPBACK}>[/post][/right][/quote]



Note that you can’t actually nest design areas. You may be able to set print=no on the Linked CSS design area, though, and then just call the <mysource_print> for the linked CSS area within the show_if.



Is there a reason why your Simple Edit CSS file needs to be a full CSS File asset and can’t just be a static CSS file? They are a lot simpler to work with. :slight_smile:

Trying not to replicate css… want to use a single source for all sites in the system…

[quote]Trying not to replicate css… want to use a single source for all sites in the system…
[right][post=“12217”]<{POST_SNAPBACK}>[/post][/right][/quote]



Just link the same CSS file under each design, then. :slight_smile:

[quote]Trying not to replicate css… want to use a single source for all sites in the system…
[right][post=“12217”]<{POST_SNAPBACK}>[/post][/right][/quote]

We have a folder containing central CSS, JS and some images that is aliased at the Apache level. Matrix is unaware of it and every sites links to it through the source in their parse file.

You lose control of it through Matrix but those file will not change often and the appropriate person will be allowed to FTP them up to the App.