Best practices for managing CSS, JavaScript, images?

View: New views
8 Messages — Rating Filter:   Alert me  

Best practices for managing CSS, JavaScript, images?

by Timothy Jones-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Greetings,

I'm just ramping up on Radiant.   Apologies if I've missed this in a  
FAQ somewhere, but I'm looking for some recommendations on managing  
these types of assets on a Radiant-based site.  I found a mailing list  
thread from 2006, but it didn't seem to have a conclusion.

With non-Radiant sites I have Apache serve up these static files,  
bypassing Rails entirely.  What are the recommended best practices  
with Radiant?  I'd like to manage them through the web interface, so  
that other folks don't have to deal with Subversion, deployment, etc.

Do folks generally just embed the CSS and JavaScript in a layout and  
serve it dynamically?  And caching?

What about images (icons, backgrounds, etc.)?  I'd like a way to  
upload and delete them from a browser, again to avoid Subversion and  
deployment hassles.  It looks like the Gallery extension might work  
for this.  Any other recommendations?

Thanks!

Tim Jones
Barbary Codes and Data
_______________________________________________
Radiant mailing list
Post:   Radiant@...
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Re: Best practices for managing CSS, JavaScript, images?

by Sean Cribbs-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tim,

Chris Parrish, with whom I've spoken privately, is working on an
extension that will allow you to manage CSS and JavaScript separate from
the page sitemap and have them be cached in some reasonable place so
they can be served by your web server.  In the meantime, you can create
pages in the sitemap that have special layouts that specify their
content type. It means an extra hit to Radiant to get the CSS or JS, but
it's a good interim solution.

To accomplish this, I would create a child of the homepage called
"Stylesheets", and create a layout for it like this:

Name: CSS
Content type: text/css
Content: <r:content />

Then create child pages of "Stylesheets" that are your individual
stylesheets, modifying the slug to end in ".css" if you desire.

You can do the same for JS.

Cheers,

Sean

Timothy Jones wrote:

> Greetings,
>
> I'm just ramping up on Radiant.   Apologies if I've missed this in a  
> FAQ somewhere, but I'm looking for some recommendations on managing  
> these types of assets on a Radiant-based site.  I found a mailing list  
> thread from 2006, but it didn't seem to have a conclusion.
>
> With non-Radiant sites I have Apache serve up these static files,  
> bypassing Rails entirely.  What are the recommended best practices  
> with Radiant?  I'd like to manage them through the web interface, so  
> that other folks don't have to deal with Subversion, deployment, etc.
>
> Do folks generally just embed the CSS and JavaScript in a layout and  
> serve it dynamically?  And caching?
>
> What about images (icons, backgrounds, etc.)?  I'd like a way to  
> upload and delete them from a browser, again to avoid Subversion and  
> deployment hassles.  It looks like the Gallery extension might work  
> for this.  Any other recommendations?
>
> Thanks!
>
> Tim Jones
> Barbary Codes and Data
> _______________________________________________
> Radiant mailing list
> Post:   Radiant@...
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>
>  

_______________________________________________
Radiant mailing list
Post:   Radiant@...
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Re: Best practices for managing CSS, JavaScript, images?

by Chris Parrish-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sean, you're too fast...

Well Timothy, you're in luck.  At John's request, I have put together an
extension to manage CSS & JS files as assets separate from normal
pages.  I've got a little rearranging that he's asked for before I
release it into the wild. Look for an announcement here soon - probably
by this weekend.

In the meantime, Sean's explanation saved me some time explaining it
here and works well enough for how (though we've all felt it a little
hack-ish -- hence the new solution).

As to other assets, Sean has a very well used PageAttachments extension,
Andrea Franz has a Gallery extension and Keith Bingman also has an
Assets extension (though he'll be the first to tell you it's not
production ready right now). Links and info on these third party
extensions can be found here:
http://wiki.radiantcms.org/Thirdparty_Extensions

-Chris

Timothy Jones wrote:

> Greetings,
>
> I'm just ramping up on Radiant.   Apologies if I've missed this in a  
> FAQ somewhere, but I'm looking for some recommendations on managing  
> these types of assets on a Radiant-based site.  I found a mailing list  
> thread from 2006, but it didn't seem to have a conclusion.
>
> With non-Radiant sites I have Apache serve up these static files,  
> bypassing Rails entirely.  What are the recommended best practices  
> with Radiant?  I'd like to manage them through the web interface, so  
> that other folks don't have to deal with Subversion, deployment, etc.
>
> Do folks generally just embed the CSS and JavaScript in a layout and  
> serve it dynamically?  And caching?
>
> What about images (icons, backgrounds, etc.)?  I'd like a way to  
> upload and delete them from a browser, again to avoid Subversion and  
> deployment hassles.  It looks like the Gallery extension might work  
> for this.  Any other recommendations?
>
> Thanks!
>
> Tim Jones
> Barbary Codes and Data
> _______________________________________________
> Radiant mailing list
> Post:   Radiant@...
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>  

_______________________________________________
Radiant mailing list
Post:   Radiant@...
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

rake db:migrate:extensions

by Brian Loomis-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've just got onto using radiant last week, it's been great to get up  
to speed fast and be able to slam out some sites that have been  
languishing.

While I've been able to install some extensions like shard fine others  
won't load when I issue:
rake db:dbmigrate:extensions

I receive the following error:

Could not load extension from file: meta_data_extension.
#<NameError: uninitialized constant MetaDataExtension>

Which I'm unsure of how to resolve.

thanks in advance

Brian Loomis
Brian Loomis
brian@...
(208) 562-3944

_______________________________________________
Radiant mailing list
Post:   Radiant@...
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Re: rake db:migrate:extensions

by Sean Cribbs-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Make sure that the directory containing the extension is named the same
as the *_extension.rb file inside it.  If it's metadata_extension.rb,
name the directory metadata, etc.

Sean

brian@... wrote:

> I've just got onto using radiant last week, it's been great to get up  
> to speed fast and be able to slam out some sites that have been  
> languishing.
>
> While I've been able to install some extensions like shard fine others  
> won't load when I issue:
> rake db:dbmigrate:extensions
>
> I receive the following error:
>
> Could not load extension from file: meta_data_extension.
> #<NameError: uninitialized constant MetaDataExtension>
>
> Which I'm unsure of how to resolve.
>
> thanks in advance
>
> Brian Loomis
> Brian Loomis
> brian@...
> (208) 562-3944
>
> _______________________________________________
> Radiant mailing list
> Post:   Radiant@...
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>
>  

_______________________________________________
Radiant mailing list
Post:   Radiant@...
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Re: rake db:migrate:extensions

by Brian Loomis-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I did change the extension folder name to match the .rb file then ran  
the command again with this error:

Could not load extension from file: page_meta_extension_extension.
#<NameError: uninitialized constant PageMetaExtensionExtension>

Am I to load extensions in to the extensions folder at the root of  
site or the entensions folder in vendors where the three that radiant  
comes with are located/

shards loaded and worked from the root extension folder but page_meta  
data will not.


On Feb 20, 2008, at 2:48 PM, Sean Cribbs wrote:

> Make sure that the directory containing the extension is named the  
> same
> as the *_extension.rb file inside it.  If it's metadata_extension.rb,
> name the directory metadata, etc.
>
> Sean
>
> brian@... wrote:
>> I've just got onto using radiant last week, it's been great to get up
>> to speed fast and be able to slam out some sites that have been
>> languishing.
>>
>> While I've been able to install some extensions like shard fine  
>> others
>> won't load when I issue:
>> rake db:dbmigrate:extensions
>>
>> I receive the following error:
>>
>> Could not load extension from file: meta_data_extension.
>> #<NameError: uninitialized constant MetaDataExtension>
>>
>> Which I'm unsure of how to resolve.
>>
>> thanks in advance
>>
>> Brian Loomis
>> Brian Loomis
>> brian@...
>> (208) 562-3944
>>
>> _______________________________________________
>> Radiant mailing list
>> Post:   Radiant@...
>> Search: http://radiantcms.org/mailing-list/search/
>> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>>
>>
>
> _______________________________________________
> Radiant mailing list
> Post:   Radiant@...
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Brian Loomis
brian@...
(208) 562-3944

_______________________________________________
Radiant mailing list
Post:   Radiant@...
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Re: rake db:migrate:extensions

by Sean Cribbs-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You are having the same problem still.  Don't use _extension on the
directory name.

Sean

brian@... wrote:

> I did change the extension folder name to match the .rb file then ran  
> the command again with this error:
>
> Could not load extension from file: page_meta_extension_extension.
> #<NameError: uninitialized constant PageMetaExtensionExtension>
>
> Am I to load extensions in to the extensions folder at the root of  
> site or the entensions folder in vendors where the three that radiant  
> comes with are located/
>
> shards loaded and worked from the root extension folder but page_meta  
> data will not.
>
>
> On Feb 20, 2008, at 2:48 PM, Sean Cribbs wrote:
>
>  
>> Make sure that the directory containing the extension is named the  
>> same
>> as the *_extension.rb file inside it.  If it's metadata_extension.rb,
>> name the directory metadata, etc.
>>
>> Sean
>>
>> brian@... wrote:
>>    
>>> I've just got onto using radiant last week, it's been great to get up
>>> to speed fast and be able to slam out some sites that have been
>>> languishing.
>>>
>>> While I've been able to install some extensions like shard fine  
>>> others
>>> won't load when I issue:
>>> rake db:dbmigrate:extensions
>>>
>>> I receive the following error:
>>>
>>> Could not load extension from file: meta_data_extension.
>>> #<NameError: uninitialized constant MetaDataExtension>
>>>
>>> Which I'm unsure of how to resolve.
>>>
>>> thanks in advance
>>>
>>> Brian Loomis
>>> Brian Loomis
>>> brian@...
>>> (208) 562-3944
>>>
>>> _______________________________________________
>>> Radiant mailing list
>>> Post:   Radiant@...
>>> Search: http://radiantcms.org/mailing-list/search/
>>> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>>>
>>>
>>>      
>> _______________________________________________
>> Radiant mailing list
>> Post:   Radiant@...
>> Search: http://radiantcms.org/mailing-list/search/
>> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>>    
>
> Brian Loomis
> brian@...
> (208) 562-3944
>
> _______________________________________________
> Radiant mailing list
> Post:   Radiant@...
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>
>  

_______________________________________________
Radiant mailing list
Post:   Radiant@...
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Re: Best practices for managing CSS, JavaScript, images?

by Casper Fabricius :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sounds good, Chris - also looking forward to this one, just what I  
need :)

On 20/02/2008, at 18:17, Chris Parrish wrote:

> Sean, you're too fast...
>
> Well Timothy, you're in luck.  At John's request, I have put  
> together an
> extension to manage CSS & JS files as assets separate from normal
> pages.  I've got a little rearranging that he's asked for before I
> release it into the wild. Look for an announcement here soon -  
> probably
> by this weekend.
>
> In the meantime, Sean's explanation saved me some time explaining it
> here and works well enough for how (though we've all felt it a little
> hack-ish -- hence the new solution).
>
> As to other assets, Sean has a very well used PageAttachments  
> extension,
> Andrea Franz has a Gallery extension and Keith Bingman also has an
> Assets extension (though he'll be the first to tell you it's not
> production ready right now). Links and info on these third party
> extensions can be found here:
> http://wiki.radiantcms.org/Thirdparty_Extensions
>
> -Chris
>
> Timothy Jones wrote:
>> Greetings,
>>
>> I'm just ramping up on Radiant.   Apologies if I've missed this in a
>> FAQ somewhere, but I'm looking for some recommendations on managing
>> these types of assets on a Radiant-based site.  I found a mailing  
>> list
>> thread from 2006, but it didn't seem to have a conclusion.
>>
>> With non-Radiant sites I have Apache serve up these static files,
>> bypassing Rails entirely.  What are the recommended best practices
>> with Radiant?  I'd like to manage them through the web interface, so
>> that other folks don't have to deal with Subversion, deployment, etc.
>>
>> Do folks generally just embed the CSS and JavaScript in a layout and
>> serve it dynamically?  And caching?
>>
>> What about images (icons, backgrounds, etc.)?  I'd like a way to
>> upload and delete them from a browser, again to avoid Subversion and
>> deployment hassles.  It looks like the Gallery extension might work
>> for this.  Any other recommendations?
>>
>> Thanks!
>>
>> Tim Jones
>> Barbary Codes and Data
>> _______________________________________________
>> Radiant mailing list
>> Post:   Radiant@...
>> Search: http://radiantcms.org/mailing-list/search/
>> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>>
>
> _______________________________________________
> Radiant mailing list
> Post:   Radiant@...
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
Radiant mailing list
Post:   Radiant@...
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
LightInTheBox - Buy quality products at wholesale price