You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by user <xx...@rambler.ru> on 2014/01/12 20:31:17 UTC
What is the legal way to add new images into the custom theme and articles?
Hello fellows! First of all thanx to all developers and customizers of this well-designed open source web application.
What I'm trying to do is to add an image into my custom theme.
First of all I have created a copy of "fauxcoly" theme and then started to study it's content. In "Media Files" chapter of my weblog I saw the folder named "icons". In this folder I saw the file named "asf-logo.png". In "Templates" chapter in the template named "standard_footer" I obtained the following tag:
<img src='$url.resource("icons/asf-logo.png")' border="0" alt="Apache feather" />
And on the rendered web page I see the link related to this tag:
http://127.0.0.1:8080/roller/main/resource/icons/asf-logo.png
So I decided to link my uploaded images from my custom theme either by "$url.resource" method or by direct link:
http://127.0.0.1:8080/roller/main/resource/images/asf-logo.png.
Then I add the image named "asf-logo.png" from Tomcat's "webapps" folder using "Media Files" chapter of admin UI. I preserved the current filename ("asf-logo.png") and assigned the folder "images" for it. So I have got two identical files: one in the directory named "icons" and another in the directory names "images". Then I'm trying to access new uploaded file by the url:
http://127.0.0.1:8080/roller/main/resource/images/asf-logo.png
And get 404 error, although the initial url works OK:
http://127.0.0.1:8080/roller/main/resource/icons/asf-logo.png
Accessing file by the model object "$url" don't work either.
What I do wrong? Why is so different behavior for user uploaded files and files copied automatically from default theme?
Tested on 5.0.1 and 5.0.3 under Tomcat 7.0.27 under OpenJDK 1.7.0_25
Re: What is the legal way to add new images into the custom theme
and articles?
Posted by Glen Mazza <gl...@gmail.com>.
On 01/12/2014 04:34 PM, user wrote:
>
> Thank you Glenn for your quick and descriptive answer. As I have
> understand from your answer the legal way of referencing to "Media
> Files" content from articles and from custom themes is to use link
> (URL) shown on "Media File Editor" window, isn't it?
Yes.
> If so, I have got two questions:
> 1) The link is looks like "cb06345c-1202-4c46-bbbe-a95c9f1fb004" and
> this is almost unreadable by user. So if I have several images
> included in the editable article I can become confused during editing
> by what each link actually means. Is there any way to address images
> by the value of "Name" field which is present in "Media File Editor"
> or any other user-friendly view?
I agree with you on that point, the cryptic URLs can cause confusion
when working with them, I assume their main purpose is to guard against
multiple files being given the same name. I blog with the old Roller
3.1 that gave user-friendly URLs for links (it didn't have the advanced
media file functionality, just simple file uploads though). I don't
know of a way to fix that, perhaps other team members would.
>
> 2) What is the actual dedication of "$url.resource" method which is
> described in the template guide as "String URL of uploaded file
> resource in weblog"?
I'm not sure -- can you paste it in a blog header (modify your template)
and see what it resolves to? (That, or check the Roller source
code--sorry, I haven't done much with media files, hopefully someone
else can help you here.)
Regards,
Glen
>
>> Пн. 13 янв. 2014 00:29:25 пользователь Glen Mazza
>> (glen.mazza@gmail.com) написал:
>>
>> Greetings, the theme management files (including images) are kept
>> separately from Media files. (Our Media File implementation is
>> actually much newer than the themes.) Normally, you would just
>> place the new images in your theme's images folder, like here for
>> fauxcoly:
>> http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/fauxcoly/images/
>> and reference them as fauxcoly does, and rebuild Roller. We have
>> many other themes listed in the Links to non-Apache resources here:
>> https://cwiki.apache.org/confluence/display/ROLLER/Roller+Wiki
>> <https://cwiki.apache.org/confluence/display/ROLLER/Roller+Wiki%3bjsessionid=1668961A2C7DE83AA43908A74478D53E>
>> that may be able to provide other ways to reference images into your
>> custom template.
>>
>> You can link to media files from your templates, but you would need
>> to use the Media Files URL given to you once you add the graphic into
>> your Media Files, as I do with my company's logo on my blog (
>> http://www.jroller.com/gmazza/ - not part of the theme, but shows up
>> due to the image link.) If you choose to go this route, you'll
>> want to do template modifications after you create your blog with
>> your custom template (using Roller's template modification screens
>> all bloggers are provided with), after getting the Media file URLs.
>>
>> It depends on what you want to do. If this graphic is something
>> that will change from blogger to blogger, let each blogger use Media
>> files to incorporate what he wants; if this is a graphic that will be
>> the same for all bloggers using your theme, don't use Media Files but
>> just incorporate it into your theme's image folder.
>>
>> Glen
>>
>> On 01/12/2014 02:31 PM, user wrote:
>> >
>> > Hello fellows! First of all thanx to all developers and customizers
>> of > this well-designed open source web application.
>> > What I'm trying to do is to add an image into my custom theme.
>> > First of all I have created a copy of "fauxcoly" theme and then >
>> started to study it's content. In "Media Files" chapter of my weblog
>> I > saw the folder named "icons". In this folder I saw the file named
>> > "asf-logo.png". In "Templates" chapter in the template named >
>> "standard_footer" I obtained the following tag:
>> > <img src='$url.resource("icons/asf-logo.png")' border="0"
>> alt="Apache > feather" />
>> >
>> > And on the rendered web page I see the link related to this tag:
>> > http://127.0.0.1:8080/roller/main/resource/icons/asf-logo.png
>> >
>> > So I decided to link my uploaded images from my custom theme either
>> by > "$url.resource" method or by direct link:
>> > http://127.0.0.1:8080/roller/main/resource/images/asf-logo.png.
>> >
>> > Then I add the image named "asf-logo.png" from Tomcat's "webapps" >
>> folder using "Media Files" chapter of admin UI. I preserved the >
>> current filename ("asf-logo.png") and assigned the folder "images"
>> for > it. So I have got two identical files: one in the directory
>> named > "icons" and another in the directory names "images". Then I'm
>> trying > to access new uploaded file by the url:
>> > http://127.0.0.1:8080/roller/main/resource/images/asf-logo.png
>> >
>> > And get 404 error, although the initial url works OK:
>> > http://127.0.0.1:8080/roller/main/resource/icons/asf-logo.png
>> >
>> > Accessing file by the model object "$url" don't work either.
>> > What I do wrong? Why is so different behavior for user uploaded
>> files > and files copied automatically from default theme?
>> > Tested on 5.0.1 and 5.0.3 under Tomcat 7.0.27 under OpenJDK 1.7.0_25
>>
>>
RE: Re: What is the legal way to add new images into the custom theme and articles?
Posted by user <xx...@rambler.ru>.
Thank you Glenn for your quick and descriptive answer. As I have understand from your answer the legal way of referencing to "Media Files" content from articles and from custom themes is to use link (URL) shown on "Media File Editor" window, isn't it?
If so, I have got two questions:
1) The link is looks like "cb06345c-1202-4c46-bbbe-a95c9f1fb004" and this is almost unreadable by user. So if I have several images included in the editable article I can become confused during editing by what each link actually means. Is there any way to address images by the value of "Name" field which is present in "Media File Editor" or any other user-friendly view?
2) What is the actual dedication of "$url.resource" method which is described in the template guide as "String URL of uploaded file resource in weblog"?
> Пн. 13 янв. 2014 00:29:25 пользователь Glen Mazza (glen.mazza@gmail.com) написал:
>
> Greetings, the theme management files (including images) are kept
> separately from Media files. (Our Media File implementation is actually
> much newer than the themes.) Normally, you would just place the new
> images in your theme's images folder, like here for fauxcoly:
> http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/fauxcoly/images/
> and reference them as fauxcoly does, and rebuild Roller. We have many
> other themes listed in the Links to non-Apache resources here:
> https://cwiki.apache.org/confluence/display/ROLLER/Roller+Wiki
> <https://cwiki.apache.org/confluence/display/ROLLER/Roller+Wiki%3bjsessionid=1668961A2C7DE83AA43908A74478D53E>
> that may be able to provide other ways to reference images into your
> custom template.
>
> You can link to media files from your templates, but you would need to
> use the Media Files URL given to you once you add the graphic into your
> Media Files, as I do with my company's logo on my blog (
> http://www.jroller.com/gmazza/ - not part of the theme, but shows up due
> to the image link.) If you choose to go this route, you'll want to do
> template modifications after you create your blog with your custom
> template (using Roller's template modification screens all bloggers are
> provided with), after getting the Media file URLs.
>
> It depends on what you want to do. If this graphic is something that
> will change from blogger to blogger, let each blogger use Media files to
> incorporate what he wants; if this is a graphic that will be the same
> for all bloggers using your theme, don't use Media Files but just
> incorporate it into your theme's image folder.
>
> Glen
>
> On 01/12/2014 02:31 PM, user wrote:
> >
> > Hello fellows! First of all thanx to all developers and customizers of
> > this well-designed open source web application.
> > What I'm trying to do is to add an image into my custom theme.
> > First of all I have created a copy of "fauxcoly" theme and then
> > started to study it's content. In "Media Files" chapter of my weblog I
> > saw the folder named "icons". In this folder I saw the file named
> > "asf-logo.png". In "Templates" chapter in the template named
> > "standard_footer" I obtained the following tag:
> > <img src='$url.resource("icons/asf-logo.png")' border="0" alt="Apache
> > feather" />
> >
> > And on the rendered web page I see the link related to this tag:
> > http://127.0.0.1:8080/roller/main/resource/icons/asf-logo.png
> >
> > So I decided to link my uploaded images from my custom theme either by
> > "$url.resource" method or by direct link:
> > http://127.0.0.1:8080/roller/main/resource/images/asf-logo.png.
> >
> > Then I add the image named "asf-logo.png" from Tomcat's "webapps"
> > folder using "Media Files" chapter of admin UI. I preserved the
> > current filename ("asf-logo.png") and assigned the folder "images" for
> > it. So I have got two identical files: one in the directory named
> > "icons" and another in the directory names "images". Then I'm trying
> > to access new uploaded file by the url:
> > http://127.0.0.1:8080/roller/main/resource/images/asf-logo.png
> >
> > And get 404 error, although the initial url works OK:
> > http://127.0.0.1:8080/roller/main/resource/icons/asf-logo.png
> >
> > Accessing file by the model object "$url" don't work either.
> > What I do wrong? Why is so different behavior for user uploaded files
> > and files copied automatically from default theme?
> > Tested on 5.0.1 and 5.0.3 under Tomcat 7.0.27 under OpenJDK 1.7.0_25
>
>
Re: What is the legal way to add new images into the custom theme
and articles?
Posted by Glen Mazza <gl...@gmail.com>.
Greetings, the theme management files (including images) are kept
separately from Media files. (Our Media File implementation is actually
much newer than the themes.) Normally, you would just place the new
images in your theme's images folder, like here for fauxcoly:
http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/fauxcoly/images/
and reference them as fauxcoly does, and rebuild Roller. We have many
other themes listed in the Links to non-Apache resources here:
https://cwiki.apache.org/confluence/display/ROLLER/Roller+Wiki
<https://cwiki.apache.org/confluence/display/ROLLER/Roller+Wiki%3bjsessionid=1668961A2C7DE83AA43908A74478D53E>
that may be able to provide other ways to reference images into your
custom template.
You can link to media files from your templates, but you would need to
use the Media Files URL given to you once you add the graphic into your
Media Files, as I do with my company's logo on my blog (
http://www.jroller.com/gmazza/ - not part of the theme, but shows up due
to the image link.) If you choose to go this route, you'll want to do
template modifications after you create your blog with your custom
template (using Roller's template modification screens all bloggers are
provided with), after getting the Media file URLs.
It depends on what you want to do. If this graphic is something that
will change from blogger to blogger, let each blogger use Media files to
incorporate what he wants; if this is a graphic that will be the same
for all bloggers using your theme, don't use Media Files but just
incorporate it into your theme's image folder.
Glen
On 01/12/2014 02:31 PM, user wrote:
>
> Hello fellows! First of all thanx to all developers and customizers of
> this well-designed open source web application.
> What I'm trying to do is to add an image into my custom theme.
> First of all I have created a copy of "fauxcoly" theme and then
> started to study it's content. In "Media Files" chapter of my weblog I
> saw the folder named "icons". In this folder I saw the file named
> "asf-logo.png". In "Templates" chapter in the template named
> "standard_footer" I obtained the following tag:
> <img src='$url.resource("icons/asf-logo.png")' border="0" alt="Apache
> feather" />
>
> And on the rendered web page I see the link related to this tag:
> http://127.0.0.1:8080/roller/main/resource/icons/asf-logo.png
>
> So I decided to link my uploaded images from my custom theme either by
> "$url.resource" method or by direct link:
> http://127.0.0.1:8080/roller/main/resource/images/asf-logo.png.
>
> Then I add the image named "asf-logo.png" from Tomcat's "webapps"
> folder using "Media Files" chapter of admin UI. I preserved the
> current filename ("asf-logo.png") and assigned the folder "images" for
> it. So I have got two identical files: one in the directory named
> "icons" and another in the directory names "images". Then I'm trying
> to access new uploaded file by the url:
> http://127.0.0.1:8080/roller/main/resource/images/asf-logo.png
>
> And get 404 error, although the initial url works OK:
> http://127.0.0.1:8080/roller/main/resource/icons/asf-logo.png
>
> Accessing file by the model object "$url" don't work either.
> What I do wrong? Why is so different behavior for user uploaded files
> and files copied automatically from default theme?
> Tested on 5.0.1 and 5.0.3 under Tomcat 7.0.27 under OpenJDK 1.7.0_25