# Assets / Attachments and Stylesheets

**URL:** <https://www.ruby-forum.com/t/assets-attachments-and-stylesheets/97928>\
**Category:** Radiant CMS\
**Created:** [July 11, 2006, 3:31pm UTC](https://www.ruby-forum.com/t/assets-attachments-and-stylesheets/97928 "2006-07-11T15:31:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gennosuke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@gennosuke](https://www.ruby-forum.com/u/gennosuke)\
**Post date:** [July 11, 2006, 3:31pm UTC](https://www.ruby-forum.com/t/assets-attachments-and-stylesheets/97928/1 "2006-07-11T15:31:28Z")

</div>

After looking at John’s screen comps for attachments (which I like),  
does this mean attachments are strictly related to a page only, or  
can you add attachments to layouts as well? Also, if you add the same  
attachment to several pages will Radiant realize this and just have  
each attachment link point to the same attachment?

Also I’ve been thinking about the way Stylesheets are currently  
handled, and while there is nothing particularly wrong with it, it it  
breaks up the hierarchy for me to see my content pages mixed in with  
my stylesheets pages. It seems like it would make sense to have a  
“Stylesheets” tab and be able to add / edit / delete stylesheets  
there. They could then just be added to pages and layouts similar to  
how attachments are assigned. This way you can still have multiple  
stylesheets on a page. Ideas?

– Larry

---

<div class="post-metadata">

**Author:** ![gennosuke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@gennosuke](https://www.ruby-forum.com/u/gennosuke)\
**Post date:** [July 11, 2006, 3:56pm UTC](https://www.ruby-forum.com/t/assets-attachments-and-stylesheets/97928/2 "2006-07-11T15:56:52Z")

</div>

On 7/11/06, Larry M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> my stylesheets pages. It seems like it would make sense to have a  
> “Stylesheets” tab and be able to add / edit / delete stylesheets  
> there. They could then just be added to pages and layouts similar to  
> how attachments are assigned. This way you can still have multiple  
> stylesheets on a page. Ideas?

I think it has value and I think it would be better than putting  
stylesheets  
in snippets or in the layouts (which I do now).

I also think that avoiding storing the attachements in the DB is better  
but the jury’s is still out for that (I like to avoid duplicating  
things).

Cheers,

---

<div class="post-metadata">

**Author:** ![gennosuke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@gennosuke](https://www.ruby-forum.com/u/gennosuke)\
**Post date:** [July 11, 2006, 5:10pm UTC](https://www.ruby-forum.com/t/assets-attachments-and-stylesheets/97928/3 "2006-07-11T17:10:22Z")

</div>

Larry M. wrote:

> After looking at John’s screen comps for attachments (which I like),  
> does this mean attachments are strictly related to a page only, or  
> can you add attachments to layouts as well? Also, if you add the same  
> attachment to several pages will Radiant realize this and just have  
> each attachment link point to the same attachment?

Attachments will probably be implemented with some level of inheritance.  
so you could do:

\<r:image src=“logo.gif” /\>

On any page and it would find the “logo.gif” attachment on the home page  
and insert a full URL to it.

> Also I’ve been thinking about the way Stylesheets are currently  
> handled, and while there is nothing particularly wrong with it, it it  
> breaks up the hierarchy for me to see my content pages mixed in with  
> my stylesheets pages. It seems like it would make sense to have a  
> “Stylesheets” tab and be able to add / edit / delete stylesheets  
> there. They could then just be added to pages and layouts similar to  
> how attachments are assigned. This way you can still have multiple  
> stylesheets on a page. Ideas?

I’ve been sensing the need for this as well. Mainly, it seems like only  
people with developer privileges should be allowed to edit the  
stylesheets. In this case it makes sense to put them on a styles tab  
which is only showing when you have developer privileges.

But stylesheets are probably not the only thing that could use this.  
Javascripts are the other asset that comes to mind. And of course global  
images would be useful, too.

Mmm. I could see that working well. If asset management was only  
something that a developer could access, and we had attachments for  
regular folks, that might solve both parts of the problem.

Feedback?

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![gennosuke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@gennosuke](https://www.ruby-forum.com/u/gennosuke)\
**Post date:** [July 11, 2006, 9:21pm UTC](https://www.ruby-forum.com/t/assets-attachments-and-stylesheets/97928/4 "2006-07-11T21:21:38Z")

</div>

> I’ve been sensing the need for this as well. Mainly, it seems like only  
> people with developer privileges should be allowed to edit the  
> stylesheets. In this case it makes sense to put them on a styles tab  
> which is only showing when you have developer privileges.

Not necessarily, while the primary stylesheets, scripts, etc that govern  
the entire site should only be editable by developers, it would make  
sense to have stylesheets that only govern a specific elements in a set  
of pages (or even a single page) be editable by non-developer users  
groups, or even a specific user. While a page-by-page permission system  
for users would be too complex to be practical, there are times where  
stylesheets should not be restricted to developers. I’d suggest a  
global assets section which might require developer privileges and  
non-global assets which includes attachments, but isn’t limited to them.

This doesn’t pertain specifically to assets, but following this stream  
of thought there should probably be a way to make assets cached  
indefinently. After all, once a website design is complete, I really  
doubt the stylesheets and scripts are going to be edited that often. It  
might be nice to have a way to save specific documents statically. This  
might not just pertain to assets though, It might make sense to allow  
users to have a choice to make pages without dynamic content to be  
cached for a longer period of time or served statically. This would be  
extremely useful if someone has a static page with high traffic by  
cutting down on the number of database queries, and processing time.

I’m currently wishing I was better at scripting and programming. I’m a  
logician dammit! I can look at the code and understand what’s happening  
but write it? Dear goodness, no.
