I'd like to create a themes that points back to the multisite folder URL for the Logo. This way, multisite specific images, like a logo, can be stored in the user's folders and not in the central codebase.
How does one access the multisite URL in the API?
(Even better would be for the user to be able to specify in the GUI the path to the logo, but I think that's a bit harder.)
-Sneeper
Posts: 8601
good question.. G2 itself doesn't need to do this, so there currently is no option for it.. but of course it is useful as you describe, and the option is easy to add. i've made the change in CVS, you can try tomorrow's nightly snapshot. or, here is a patch to modules/core/classes/GalleryUrlGenerator.class
with this change you can do: {g->url href="images/site.jpg" forceDirect=true}
and this will be relative to the multisite dir instead of the codebase dir.
Posts: 397
Mindless, was this ever implemented? I rooted through the code and did not see this. If it was, possible to expand on the usage a little more? Am mucking through the multi-site and unique logo thing, trying to come up with a solution without cloning, tho that is of course an option.
tx
Posts: 8601
yes, it is there. get current svn or nightly snapshot.
can't think of a better example than the one I gave. try that g->url call with and without forceDirect=true to see the difference.
Posts: 397
My skill level is not quite there to understand the usage. At the risk of getting yelled at, would you mind adding a sentence or two on usage. I will work to muck my way through understanding what I am looking at.... but can you add a little more on actual usage?
What I think this means is, in a multi site installation, I create a subdir named ???, and can place logo.gif inside it and change the true/false statement in the code? How far off am I??
Commence yelling at another low skilled worker, me...
Posts: 8601
okee.. example:
codebase: http://example.com/g2codebase/
multisite: http://example.com/myg2/
{g->url href="images/mylogo.png"} --> http://example.com/g2codebase/images/mylogo.png
{g->url href="images/mylogo.png" forceDirect=true} --> http://example.com/myg2/images/mylogo.png
The reason I asked you to try it is then you could have seen this difference firsthand.
So, create a directory called images in the multisite dir, use g->url with forceDirect=true to point at that directory (that directory in EACH multisite.. so you'll need one in each)
Posts: 397
Hello, and thank you for your responses. After plinking around G2 for awhile, I have finally come to realize that I need to learn PHP and the logic of the code so I can do these things on my own. I owe that to the G2 team.
So, you're still gonna shoot me but I have to ask.... where is "g->url with forceDirect=true" applied?
In modules/core/classes/GalleryUrlGenerator.class ??? I am pulling the current build right now and will look for this string, but I am still not clear where this is applied, tho I understand the creation of the images/mylogo.png in each multisite dir.
Posts: 8601
when you look around the code you'll find that g->url is used in tpl files.
try testing by putting it in themes/{yourtheme}/templates/theme.tpl
Posts: 397
NOW I get it. Makes sense. And as it would go, I've been fiddling with PGTheme which has a different construct. Natch. But this is a good task to tackle. But it makes sense now.... mucho gracias.
Posts: 10
I removed my comment and question about passing HTTP_HOST to theme.tpl from here and posted it as a new question as suggested...
http://gallery.menalto.com/node/49802
Posts: 8601
Please start a new topic for your question.
Posts: 20
Thank you, mindless!
This change is a Good Thing. I now created a "Classic With Unique Logo" and a "Matrix With Unique Logo", which are identical to Matrix and Classic but looks for (multisite)/images/logo.png for the logo, and now my users can have their own logo at the top of their site.
What would REALLY be useful is the ability for them to have their own themes in their multisite folder. This way they can really customize their multisite install (maybe they want to center their logo?). Right now, they have no way to do that other than colorpacks.
Is there any plan to allow themes in multisite folders?
Posts: 8601
sorry, no plans atm..