Welcome to Sign in | Join | Help
in
Home Forums Photos Downloads

Virtual Directories and Themes.

Last post 07-15-2007, 7:18 PM by Rangoric. 8 replies.
Sort Posts: Previous Next
  •  05-28-2007, 2:21 PM 966

    Virtual Directories and Themes.

    Ok, I'm just going to draw a picture and then ask why god why.  I have been trying to google up an answer but it seems to be.... Elusive.

    Here is the Directory Structure I WANT to use.

     

    • Website 1
    • Website 2
    • Shared
      • Images
      • App_Themes
        • Theme
      • OGL

    Originally, Images and App_Themes where in Website 1.  Since I wanted to share them with all my websites, I moved them to the shared folder that I created.  Then I added "Images" and "App_Themes" as virtual directories to Website 1.

    Having done this, Website 1 works exactly the same as before.  I did not have to change anything, or modify any setting.

    However when I moved the OGL folder and did the same, any aspx pages in that virtual directory come up with a Theme Not Found Error.  (The Theme is declared in the web.config file in Website 1 root folder).

    Now, Moving the App_Themes folder back does nothing, so I figure it has to do with the aspx file being in a virtual directory that is outside the "Website's" directory.

    I know I could combine the websites, but I am not going to, I'd rather duplicate the pages.  So if anyone has any idea why this is happening I'd love the help.

    Once I get that working I plan on moving the App_Code files out also.  But for some reason I think that will be easier.  But one step at a time :)


    -Wilson Gearld Mead III
    www.rangoric.com (Rather Blah)
    blog.rangoric.name (Closer to Not Blah)
  •  05-31-2007, 2:20 PM 968 in reply to 966

    Re: Virtual Directories and Themes.

    Solved the Issue on my own.

    Its impossible.  master Pages are unable to be outside the application that the current page is a part of, and a virtual directory is considered its own web application as long as its outside the root web directory.

    I was able to use the theme (or master page) by coping them to the location that had the "Shared" page, but due to the fact that any 2 websites that would want to share a web page for me, anyways, will also have different master pages.

    Its easier copy the files between web sites at this point.  Although I am glad its just minor things that only get updated once in a while.  Like on a blue moon.


    -Wilson Gearld Mead III
    www.rangoric.com (Rather Blah)
    blog.rangoric.name (Closer to Not Blah)
  •  05-31-2007, 11:26 PM 969 in reply to 968

    Re: Virtual Directories and Themes.

    Glad I could help!  LOL  :-)

    Makes sense that master pages can't be shared across multiple sites.  However, couldn't you make each of the two sites it's own VS Project under the same Solution?  I've never tried it, but maybe that would allow you to share Master pages?


    William Eaton, MCSE
    iTech Computer Solutions, LLC
    www.itechcs.com
  •  06-01-2007, 12:10 AM 970 in reply to 969

    Re: Virtual Directories and Themes.

    itechcs:

    Glad I could help!  LOL  :-)

    Yes, Thank you!  ^_^

    Makes sense that master pages can't be shared across multiple sites.  However, couldn't you make each of the two sites it's own VS Project under the same Solution?  I've never tried it, but maybe that would allow you to share Master pages?

    Nope, as soon as the master page is outside the IIS Web Application, IIS denies it.  It does the same thing with Code files.  I was unable to have App_Code in my shared directory because IIS does not support having code outside the web application. 

    However if you mean having the other websites be "child" websites, that is something I haven't really thought of, but I would want anyone browsing into the child website to automagically be redirected to the proper domain name.  Shouldn't be too hard to do.

    The only problem I am having with this method is that I am picturing a web directory structure like follows:

     

    • Website 1
      • Website 2
        • Website 3
          • Website 4
            • Shared Pages

    Which is something else I'd rather not do.  At this point I'm having to settle with having my Login Pages be copied onto each web domain/site and also my OGL.  Since the login pages won't ever really change (they are only for me and one other person to log in and change/edit content) and since the OGL I can eventually put into a shared DB, it shouldn't be too big a problem.  And it should entice me to learn Stored and CLI procedures for SQL sooner rather then later as most of the code I will be sharing is just that, SQL stuff.

    Thankfully the larger directories I needed to share can be, like the themes and images.


    -Wilson Gearld Mead III
    www.rangoric.com (Rather Blah)
    blog.rangoric.name (Closer to Not Blah)
  •  06-01-2007, 10:05 AM 971 in reply to 970

    Re: Virtual Directories and Themes.

    What about a structure such as:

    • Website 1
      • Shared Pages
      • Website 2
      • Website 3
      • Website 4

    Also, is there a specific need to make sites 2, 3 and 4 virtual directories instead of just a folder under site 1?  If it's just a folder, it can share everything that is in site #1.

     


    William Eaton, MCSE
    iTech Computer Solutions, LLC
    www.itechcs.com
  •  06-01-2007, 1:24 PM 972 in reply to 971

    Re: Virtual Directories and Themes.

    Ok now I feel like I'm missing something.

    itechcs:

    What about a structure such as:

    • Website 1
      • Shared Pages
      • Website 2
      • Website 3
      • Website 4

    Still has the issue that Website 2 is a different web app from the Shared Pages.  Since Website 2 is pointed at by www.net as opposed to Website 1's www.com it counts as a different web app.  At least this is my understanding.  I know sub projects in Visual Studio work like that.  I was unable to share the Themes in the base project with the sub projects.  (Theme Not Found Errors are fun, especially when you are looking right at them. >_< )

    Also, is there a specific need to make sites 2, 3 and 4 virtual directories instead of just a folder under site 1?  If it's just a folder, it can share everything that is in site #1.

    Can domains point at those websites still?  Site 2, 3, 4 are virtual directories only in that I have "Web Sites" set up in the DNP to point domain names at them. I will give that idea a shot when I next get the chance, and also check if there is a way to point domain names at directories without making it a virtual directory (the DNP "Make Website" thing does make it a virtual directory right?)


    The Specific Need that I have is each website is different in focus and functionality. The only things that are shared between the websites:
    The login code (That I use to go in and change/add content)
    The OGL (License that I use for some of the content, I am thinking of changing this into a .html and just importing it though)
    Themes & Images (To have a uniform look between the websites, and eventually let people pick their own theme)

    Code is kinda shared, only one class is really shared, the rest are specific to a website. Which is why I am not too worried about copying the code around, only 1 file will actually be shared, but if I could share the folder I would and just make life that much easier.

    So Basically the Visible to the online world setup is:

    • www.com
    • www.net
    • www.org
    • www.info

    Which gives me:

    • Base
      • www.com
      • www.net
      • www.org
      • www.info
      • Shared Stuff
    Now to try your idea I will have:
    • Base
      • www.com
        • Shared Stuff
        • www.net
        • www.org
        • www.info

    Which I don't mind the look of at all. I would just have to force the viewing of those child sites to force the domain name change (which should be trivial, just like forcing the use of www).

    I know it screams to be 1 site, and at some point I may join some of the websites, but for now I'm keeping them seperate.  Once I have some of the sites actually partially finished or up to speed, I will think about joining them together.  At this point I want to keep them seperate so that if I break one for some reason its just that one that is broken and not all of them.  For instance the site where I am putting my writings is almost finished in terms of functionality, while the Atlas for the fantasy world I am using for that story is hardly started, and I am still getting my ideas in order for it, I like that its completely seperate except for what is shared, and that the shared is in a very different directory letting me only know that the things for that site specifically are the only things that can break it.  That there are no Web.config or Globals that are influencing it at all.


    -Wilson Gearld Mead III
    www.rangoric.com (Rather Blah)
    blog.rangoric.name (Closer to Not Blah)
  •  06-01-2007, 1:41 PM 973 in reply to 972

    Re: Virtual Directories and Themes.

    If the only thing that is really shared is just a few files, I'd say just copy the files into each app folder like you originally thought.  If you have code that is shared, you could compile that code into a DLL and then put that DLL in each app.


    William Eaton, MCSE
    iTech Computer Solutions, LLC
    www.itechcs.com
  •  07-15-2007, 5:48 PM 1032 in reply to 973

    Re: Virtual Directories and Themes.

    You may be able to share code via a Virtual Directory if you do NOT set it up as an application.  The control panel automatically sets the vdir up as an app and there seems to be no way to change it without calling support.  In IIS you just pull up the vdir and click the "Remove" button under Application Settings.  See image below:

    Does anyone know how to do this using the the control panel?

    Remove App from Virtual Directory 

     

  •  07-15-2007, 7:18 PM 1034 in reply to 1032

    Re: Virtual Directories and Themes.

    fcsobel:

    You may be able to share code via a Virtual Directory if you do NOT set it up as an application.  The control panel automatically sets the vdir up as an app and there seems to be no way to change it without calling support.  In IIS you just pull up the vdir and click the "Remove" button under Application Settings.  See image below:

    I've moved alot of the shared code into the Database (well what should be in there anyways), and just copy paste the Shared Pages. However that does explain the problem as that is how I ended up getting it to work on my computer.

    As I've done a bit more with my site though, the need to have the code shared has been decreasing.  The only real part that needs to be shared is the login stuff so I can play with the database functionality and such.


    -Wilson Gearld Mead III
    www.rangoric.com (Rather Blah)
    blog.rangoric.name (Closer to Not Blah)
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems