tel8618217223380 / prado3

Automatically exported from code.google.com/p/prado3
Other
0 stars 0 forks source link

TThemeManager BaseUrl does not work. #211

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
*** What I want to do:
I want to access the themes directory with the URL
www.website.com/themes.

========================================================================
*** What I have:
Prado version 3.1.6
I have a directory structure as follows:
.../website
      |
      +-assets
      |
      +-protected
      |   |
      .   +-Themes
      ..  ..

Application.xml looks like:
<application id="MyWebSite" mode="Normal">
  <services>
    <service id="page" 
             class="TPageService" 
             BasePath="Application.Pages" 
             DefaultPage="Home">
      <modules>
        <module id="themes" 
                class="System.Web.UI.TThemeManager" 
                BasePath="Application.Themes" 
                BaseUrl="themes" />
      </modules>
    </service>
  </services>
</application>

========================================================================
*** What I get:
When I go to "www.website.com/themes" (i.e. the BaseUrl of the "themes" 
module) I get error 404 (object not found).
When I go to "www.website.com/protected/themes" I get to see the installed 
themes.
It looks like the url is the basePath instead of the baseUrl.

Original issue reported on code.google.com by o.rijk...@gmail.com on 10 Dec 2009 at 2:38

GoogleCodeExporter commented 9 years ago
You're thinking backwards. By specifying the BaseUrl property you don't tell 
Prado 
to make your themes appears under that specific base URL, but rather you tell 
Prado 
to tell the clients (browsers) to look for your themes under that specified 
base 
URL. Now, if you placed your themes under "protected/Themes", then you have to 
set 
the BaseUrl property to "protected/Themes" in order to get a properly 
functioning 
output from Prado. Ensuring that your theme file are available and server up 
under "/themes" is not the job of Prado, but those of you and your webserver 
(ie. 
you have to set up it properly). 

If 'www.website.com/" points to your Prado root, then your themes should be 
available without any problem under 'www.website.com/themes' - but only if you 
preserved the default Prado project layout. You obviously didn't do that, but 
moved 
your themes directory to '/protected/themes' - that's why they're visible only 
there. That's not only pointless, but also bad practice. You are strongly 
advised 
against placing anything intended to be publicly accessible under "protected/", 
because that defies the purpose of having that separate directory in the first 
place. Anything under "/protected" shouldn't be directly accessible for the 
webserver to serve up to the clients, as that might potentially open up a 
security 
hole. Rather, themes are - and should be - placed by default outside of 
the "/protected" subtree (actually, they're in "/themes"), and if you need 
anything 
else to publish towards the browsers (like a stylesheet, an image, or 
whatever), 
then you should either store that stuff outside of the protected subtree in the 
first place, or move/copy it to there (for ex. to the "/assets" folder) 
whenever 
referenced in the web page.

Original comment by google...@pcforum.hu on 25 Dec 2009 at 10:05

GoogleCodeExporter commented 9 years ago

Original comment by Christophe.Boulain@gmail.com on 12 Jan 2010 at 10:18