You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Alexander Coles <al...@gmail.com> on 2008/06/24 17:30:17 UTC

Developing Themes for Roller - Making Velocity Reload

Hi,

Apologies first of all for cross-posting. This actually belongs more  
on the Dev list (I think? - Im not sure 100% since this a 3rd-party  
development)..

I am trying to create a couple themes, and am working on getting the  
workflow right. Although Velocity doesn't interfere too much with the  
flow of HTML, and I can get a rough idea of what it'll look like  
without the markup being fully rendered, I want to setup my workflow  
so I can work on Velocity templates "live" and see changes  
immediately. I believe this should be possible?

I have created a separate roller_themes/ directory outside of WEB-INF  
and set it as my themes.dir.

I am having problems finding the right configuration so that both  
Velocity and Application / Roller caching is switched off - and that  
the .vm templates are reparsed/regenerated each time.

For the Application caching, I have tried the following settings in  
roller-custom.properties:
cache.sitewide.enabled=false
cache.weblogfeed.enabled=false
cache.weblogpage.enabled=false

(of which, I think only cache.weblogpage.enabled=false is really  
needed).

For turning off Velocity Caching, I have made sure the settings in  
roller/WEB-INF/velocity.properties are as follows:

theme.resource.loader.cache=false
roller.resource.loader.cache=false
class.resource.loader.cache=false
webapp.resource.loader.cache=false
velocimacro.library.autoreload=true

Naturally I have restarted the web application after making these  
configuration changes, but unfortunately, to no avail. Restarting the  
web application of course, reloads the changed templates.

Help very much appreciated. I am not familiar enough with Velocity to  
know if there is something I am missing.
Many thanks,

Alex

Re: Developing Themes for Roller - Making Velocity Reload

Posted by Alexander Coles <al...@gmail.com>.
On Jun 27, 2008, at 6:25 AM, Richard Jones wrote:

> Hi Alex,
>
> Changing the permalink is quite straightforward, you just need to edit
> the following class:
>
> org.apache.roller.weblogger.pojos.WeblogEntry
>
> and change this:
>
>
> public String createAnchorBase() {
>   ...
>   tmp = (tmp == null) ? s : tmp + "_" + s;
>   ...
> }
>
>
> to this:
>
>
> public String createAnchorBase() {
>   ...
>   tmp = (tmp == null) ? s : tmp + "-" + s;
>   ...
> }
>
>
> Apparently hyphens are more SEO friendly... so I've been told.
>
> Cheers,
>
> Richard
>


Thanks!

I prefer it for aesthetic reasons too (don't ask why! -- maybe I'm  
just too used to MT, WP style permalinks!)

Is there enough of a consensus for me to put a ticket in for this? Or,  
at least to make it customisable?

Alex

Re: Developing Themes for Roller - Making Velocity Reload

Posted by Richard Jones <ri...@pixyblog.com>.
Hi Alex,

Changing the permalink is quite straightforward, you just need to edit
the following class:

org.apache.roller.weblogger.pojos.WeblogEntry

and change this:


public String createAnchorBase() {
   ...
   tmp = (tmp == null) ? s : tmp + "_" + s;
   ...
}


to this:


public String createAnchorBase() {
   ...
   tmp = (tmp == null) ? s : tmp + "-" + s;
   ...
}


Apparently hyphens are more SEO friendly... so I've been told.

Cheers,

Richard





2008/6/26 Alex Coles <al...@gmail.com>:
> On Wed, Jun 25, 2008 at 6:32 AM, Richard Jones <ri...@pixyblog.com> wrote:
>> Hi Alex,
>>
>> The way we create new themes is to work with a "custom" theme.  All we
>> do is take an existing theme, customize it (which copies the theme
>> templates into the database), then through the Roller UI we can edit
>> each template in-turn and the changes take effect immediately.  Also,
>> any stylesheets we use are also kept in a page template... that way we
>> can make changes to the styles immediately too.  Normally we would
>> have the static HTML mock of the theme already made-up with
>> Dreamweaver (or whatever you use), and it's just a case of splitting
>> that up into the various templates and getting it working and
>> displaying right.  Once we're happy with the theme, we take each of
>> the page templates from the Roller UI and copy them into the themes
>> directory.
>>
>> Hope that makes sense.
>>
>> Cheers,
>>
>> Richard
>>
>
> Hi Richard,
>
> Thanks for your message. Its must appreciated! Of course, as with most
> designs, its best to start with mockups (wireframes -> static HTML). I
> am already doing that -- I just want to another stage in the process,
> which is to test with velocity markup added and rendered.
>
> I'd still prefer to be able to do this with the themes in file format,
> so I can take advantage of version control (since that's where my
> themes will end), but your suggestion sounds like a good workaround.
>
> OFF-TOPIC, but I was wondering how you've achieved hyphens rather than
> underscores in your permalinks on pixyblog? I have  a preference for
> the former. If its not under NDA, I'd love to know how!
>
> Cheers,
>
> Alex
>
>

Re: Developing Themes for Roller - Making Velocity Reload

Posted by Alex Coles <al...@gmail.com>.
On Wed, Jun 25, 2008 at 6:32 AM, Richard Jones <ri...@pixyblog.com> wrote:
> Hi Alex,
>
> The way we create new themes is to work with a "custom" theme.  All we
> do is take an existing theme, customize it (which copies the theme
> templates into the database), then through the Roller UI we can edit
> each template in-turn and the changes take effect immediately.  Also,
> any stylesheets we use are also kept in a page template... that way we
> can make changes to the styles immediately too.  Normally we would
> have the static HTML mock of the theme already made-up with
> Dreamweaver (or whatever you use), and it's just a case of splitting
> that up into the various templates and getting it working and
> displaying right.  Once we're happy with the theme, we take each of
> the page templates from the Roller UI and copy them into the themes
> directory.
>
> Hope that makes sense.
>
> Cheers,
>
> Richard
>

Hi Richard,

Thanks for your message. Its must appreciated! Of course, as with most
designs, its best to start with mockups (wireframes -> static HTML). I
am already doing that -- I just want to another stage in the process,
which is to test with velocity markup added and rendered.

I'd still prefer to be able to do this with the themes in file format,
so I can take advantage of version control (since that's where my
themes will end), but your suggestion sounds like a good workaround.

OFF-TOPIC, but I was wondering how you've achieved hyphens rather than
underscores in your permalinks on pixyblog? I have  a preference for
the former. If its not under NDA, I'd love to know how!

Cheers,

Alex

Re: Developing Themes for Roller - Making Velocity Reload

Posted by Richard Jones <ri...@pixyblog.com>.
Hi Alex,

The way we create new themes is to work with a "custom" theme.  All we
do is take an existing theme, customize it (which copies the theme
templates into the database), then through the Roller UI we can edit
each template in-turn and the changes take effect immediately.  Also,
any stylesheets we use are also kept in a page template... that way we
can make changes to the styles immediately too.  Normally we would
have the static HTML mock of the theme already made-up with
Dreamweaver (or whatever you use), and it's just a case of splitting
that up into the various templates and getting it working and
displaying right.  Once we're happy with the theme, we take each of
the page templates from the Roller UI and copy them into the themes
directory.

Hope that makes sense.

Cheers,

Richard



2008/6/24 Alexander Coles <al...@gmail.com>:
> Hi,
>
> Apologies first of all for cross-posting. This actually belongs more on the
> Dev list (I think? - Im not sure 100% since this a 3rd-party development)..
>
> I am trying to create a couple themes, and am working on getting the
> workflow right. Although Velocity doesn't interfere too much with the flow
> of HTML, and I can get a rough idea of what it'll look like without the
> markup being fully rendered, I want to setup my workflow so I can work on
> Velocity templates "live" and see changes immediately. I believe this should
> be possible?
>
> I have created a separate roller_themes/ directory outside of WEB-INF and
> set it as my themes.dir.
>
> I am having problems finding the right configuration so that both Velocity
> and Application / Roller caching is switched off - and that the .vm
> templates are reparsed/regenerated each time.
>
> For the Application caching, I have tried the following settings in
> roller-custom.properties:
> cache.sitewide.enabled=false
> cache.weblogfeed.enabled=false
> cache.weblogpage.enabled=false
>
> (of which, I think only cache.weblogpage.enabled=false is really needed).
>
> For turning off Velocity Caching, I have made sure the settings in
> roller/WEB-INF/velocity.properties are as follows:
>
> theme.resource.loader.cache=false
> roller.resource.loader.cache=false
> class.resource.loader.cache=false
> webapp.resource.loader.cache=false
> velocimacro.library.autoreload=true
>
> Naturally I have restarted the web application after making these
> configuration changes, but unfortunately, to no avail. Restarting the web
> application of course, reloads the changed templates.
>
> Help very much appreciated. I am not familiar enough with Velocity to know
> if there is something I am missing.
> Many thanks,
>
> Alex
>
>