Random Background for only 1 of 5 styles

Discuss the development and implementation of Joomla! modules here.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
pcuser32
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sun Jan 28, 2007 12:36 am

Random Background for only 1 of 5 styles

Post by pcuser32 » Sun Nov 15, 2009 6:41 pm

Hi
not sure if this is possible
I'm running the comuna3_plazza template from TemplatePlazza
and the random background module from joomla4more

The comuna3 templale has a style switcher
I would like a random background only when the website first loads
after which the stylechanger can change the look of the site.
is this posible?

right now when ever i change to another style the background changes as well
not good...

not very php savy any help is appreciated

edit:
I know this requisres some type of if else condition just dont know where or how to construct it

random background module uses "<jdoc:include type="modules" name="user1" style="xhtml"/>;"
placed in template index after css statment

style changer stores variable for styles is this statement i believe:
$d_fstyle = $this->params->get('templatestyle');

how should code look if style = style1 execute code other wise skip or exclude type

EDIT: found style variable
with this code
<?php
if ( $style == "style1" ) {
echo "<font color='white'>Style1 selected</font><br />";
}
else {echo "Not style1!";
}
?>
just need to figure how to insert the
"<jdoc:include type="modules" name="user1" style="xhtml"/>;"
command

and exclude it if a different style sheet is select

am i on the right track?

anyone here speak php?


/tia

RC

pcuser32
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sun Jan 28, 2007 12:36 am

Re: Random Background for only 1 of 5 styles

Post by pcuser32 » Mon Nov 16, 2009 8:44 am

Well figured out the solution after looking thru lots of php code I constructed this
code:

<?php if($style == "style1") { ?>
<div id="headermodule">
<jdoc:include type="modules" name="user1" style="xhtml"/>
</div>
<?php } ?>

may not be the best way to do it but it works

may help some one else trying to figure out how to do this

/rc

User avatar
pmcnamara
Joomla! Guru
Joomla! Guru
Posts: 572
Joined: Fri Nov 10, 2006 7:05 pm
Location: Detroit, Michigan, USA
Contact:

Re: Random Background for only 1 of 5 styles

Post by pmcnamara » Sat Dec 19, 2009 3:53 pm

@pcuser.. I was wondering if you could help me adapt your code to what an effect I'm looking to achieve.

I have three URL's I want to work with..

url1.com, url2.com, url3.com

now.. url1.com is the primary url, the other two are just addon domains which end up pointing at the same server, but the domain name gets rewritten to reflect.

If you would like to see an example of what I mean.. this is the site I'm working on and where this project is going to take place.

Michigan Circle Track

If you go there, you'll see in your browser window, your at michigancircletrack.com

Now.. I have parked MARC Times Racing News and Michigan Racing Scene at the same server.. so if you click on those URL, you will see the same website, but the URL in the browser window reflects the add-on domain name.

Okay... but the problem.. the header still says "Michigan Circle Track"

I was wondering if there was a way to have the logo file load based on the URL which called it..

So if the person browsed michigancircletrack.com.. then the mct_logo.png would load into the header..

But if they went to marctimesracingnews.com.. then the mtrn_logo.png would load..

and same for any other add-on domain.

Outside that, nothing else changes.. the browser bar already does what it is suppose to do, but I think the site visitor is confused when they type in the URL "marctimesracingnews.com" and they get "MichiganCircleTrack.com"

IF it is not possible to call a different logo.png, is it possible to call a different template ?

would it be possible to call:

template/red for MichiganCircleTrack.com
template/blue for MarcTimesRacingNews.com
template/black for MichiganRacingScene.com

that way the logo.png in the template/color/images folder for each template would reflect the correct name ?

Maybe this is a better option ? As then the site colors could be different also, even though everything else.. module positions, content, menus, everything else would stay the same.

Anyone have any thoughts or ideas how this could be accomplished or if it is already readily available and I am just not aware ?

Thank you in advance for any assistance.

keremsah
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Jan 05, 2010 11:49 pm

Re: Random Background for only 1 of 5 styles

Post by keremsah » Wed Jan 06, 2010 6:14 am

seems like working fine now...

User avatar
pmcnamara
Joomla! Guru
Joomla! Guru
Posts: 572
Joined: Fri Nov 10, 2006 7:05 pm
Location: Detroit, Michigan, USA
Contact:

Re: Random Background for only 1 of 5 styles

Post by pmcnamara » Wed Jan 06, 2010 6:43 am

not on my site, i don't have it yet

dorapatton1
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Dec 03, 2011 12:10 am

Re: Random Background for only 1 of 5 styles

Post by dorapatton1 » Sat Dec 03, 2011 12:15 am

Did anyone figure out how to do this. I need something similar. I have one company name and branding for the west coast and a different company name and branding for the east coast.

User avatar
pmcnamara
Joomla! Guru
Joomla! Guru
Posts: 572
Joined: Fri Nov 10, 2006 7:05 pm
Location: Detroit, Michigan, USA
Contact:

Re: Random Background for only 1 of 5 styles

Post by pmcnamara » Sat Dec 03, 2011 6:22 am

Chamleon does this..


Locked

Return to “Modules”