# Sitewide Assets

**URL:** <https://www.ruby-forum.com/t/sitewide-assets/143252>\
**Category:** Radiant CMS\
**Created:** [July 16, 2008, 7:15pm UTC](https://www.ruby-forum.com/t/sitewide-assets/143252 "2008-07-16T19:15:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 16, 2008, 7:15pm UTC](https://www.ruby-forum.com/t/sitewide-assets/143252/1 "2008-07-16T19:15:18Z")

</div>

How do people handle site-wide assets like background images? I’d  
like to keep everything about the site able to be uploaded/changed.  
I’ve got the page\_attachments extension, but that seems like it’s only  
applicable to individual pages.

I’ve looked at something like the paperclipped, but that seems to  
overwrite some of the page attachments functionality.

> **[GitHub - kbingman/paperclipped: Please note, this extension is no longer being...](https://github.com/kbingman/paperclipped/tree/master)**
>
> master

I’d like to use page\_attachments, so what work-arounds are possible  
for sitewide stuff, outside of having to deploy them in public/images/\*?

Regards,  
Josh

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 16, 2008, 7:27pm UTC](https://www.ruby-forum.com/t/sitewide-assets/143252/2 "2008-07-16T19:27:00Z")

</div>

There my be an easier way to do this but I use the \<r:attachment:url /

> tag to discover the actual location of the image. Then if I want,  
> I can use that information in my css file.

Steven

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 16, 2008, 7:31pm UTC](https://www.ruby-forum.com/t/sitewide-assets/143252/3 "2008-07-16T19:31:05Z")

</div>

Sean,

That seems easy enough, I assume then that you are not using the  
Scripts N Styles extension then? Maybe that’s the extension that  
needs to be written, making page\_attachments work with scripts/n/  
styles. I know SNS has a more ‘pluggable’ interface now.

Josh

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 16, 2008, 7:27pm UTC](https://www.ruby-forum.com/t/sitewide-assets/143252/4 "2008-07-16T19:27:35Z")

</div>

Josh,

Since things like background images are generally applied with CSS, I  
like to store my CSS in a Radiant page and then attach the images to  
that CSS page.

Sean

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 16, 2008, 7:35pm UTC](https://www.ruby-forum.com/t/sitewide-assets/143252/5 "2008-07-16T19:35:46Z")

</div>

Josh,

Although I like what Chris has done, I haven’t had a need for SNS yet.  
I may in the near future, as I potentially have more than one Radiant  
project on my plate soon.

Sean

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 16, 2008, 7:49pm UTC](https://www.ruby-forum.com/t/sitewide-assets/143252/6 "2008-07-16T19:49:50Z")

</div>

Ok, that’s twice in one week (Jim G. just asked for the same thing). I  
don’t think this tag belongs in SnS since it depends on Page Attachments  
too but a new extension for it might be nice.

Anyone willing to whip up a mini-extension that simply adds the  
necessary image tags to the Stylesheet object? I don’t imagine there’d  
be much there to do – I’m just not familiar enough with Page  
Attachments to know its tags?

Otherwise I’ll look into it in a couple of days.

-Chris

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 16, 2008, 8:07pm UTC](https://www.ruby-forum.com/t/sitewide-assets/143252/7 "2008-07-16T20:07:59Z")

</div>

I’ve been thinking I’d try to tackle it, but I’m swamped and I’d love  
to see it started.

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 16, 2008, 9:27pm UTC](https://www.ruby-forum.com/t/sitewide-assets/143252/8 "2008-07-16T21:27:05Z")

</div>

On Wed, Jul 16, 2008 at 2:59 PM, J Aaron F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Assets extension though.  
> We wrote a dead simple assets extension a little while ago. It just lets  
> you  
> to upload files directly into radiant’s public directory. We use  
> page\_attachments for almost everything but it has been handy for pushing  
> out  
> downloadable files, third party scripts, and other files that we don’t  
> want  
> to exist under the page\_attachements/dddd/dddd structure. Would this be  
> of  
> interest to anyone else?

Cheers,  
Stephen

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 16, 2008, 9:00pm UTC](https://www.ruby-forum.com/t/sitewide-assets/143252/9 "2008-07-16T21:00:09Z")

</div>

Josh S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> How do people handle site-wide assets like background images? I’d  
> like to keep everything about the site able to be uploaded/changed.  
> I’ve got the page\_attachments extension, but that seems like it’s only  
> applicable to individual pages.

I started created a generic “Assets” extension for this purpose but  
ended up just using the Gallery extension. I’d still prefer a simple  
Assets extension though.

–  
J Aaron F. [jadetower.com](http://jadetower.com) [US] +1 724-964-4515  
é¦®å‚‘ä» [cubiclemuses.com](http://cubiclemuses.com) [HK] +852 8123-7905

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 17, 2008, 12:01am UTC](https://www.ruby-forum.com/t/sitewide-assets/143252/10 "2008-07-17T00:01:52Z")

</div>

I would love to see it.

Regards,  
Josh

---

<div class="post-metadata">

**Author:** ![joshs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@joshs](https://www.ruby-forum.com/u/joshs)\
**Post date:** [July 16, 2008, 9:27pm UTC](https://www.ruby-forum.com/t/sitewide-assets/143252/11 "2008-07-16T21:27:41Z")

</div>

Paperclipped is intended to replace page\_attachments, I wouldn’t use  
both at the same time. I wanted to use something other than  
attachment\_fu, so I wrote with different functionality than either  
gallery or page\_attachments. I hope that it offers something that  
these do extensions do not. I actually use all three.

There are several ways you could use page\_attachments with site wide  
images. Sean’s suggestion would be the easiest. Paperclipped uses the  
same file structure as paperclipped (as I had started using  
attachment\_fu), so it is easy to switch if you wish.

You could also add a tab to page\_attachments, gaining acces to all the  
uploaded images images…

Regards,  
Keith
