Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Unique Joomla front template page link color problem

Posted on 2014-01-30
7
457 Views
Last Modified: 2014-02-10
I have a website that uses Joomla for content management.  It was developed to have a unique front page outside of the rest of the content that is configurable within Joomla itself.  I am trying to make this front page have a slightly different color scheme than the rest of the site (completely black background instead of half black half silver).  The footer that is on each page includes a link to the sitemap which I would prefer to leave on the front page as well.  The problem is that I cannot independently change the black sitemap link, that shows up as desired (on the silver background) for the rest of the Joomla controlled site,  to be silver on the entirely black background of the unique front page.  I believe I should be able to create a div element and reference this element in the CSS to do just this but anything I try either has no effect or changes all links on the page, including a nav bar at the top of the page.  I don't know if I should maybe try to used the modules.php file I will include the relevant CSS and PHP code below.  The site itself is HERE

index.php:
<footer id="primary-footer" class="container">
	<jdoc:include type="modules" name="footer-navigation" style="navigation" />
</footer>

Open in new window


screen.css:
a:link, a:visited{color:#000;}
a:hover{text-decoration:underline;}

#primary-footer{padding-top:15px; text-align:center; margin-bottom:20px; }
#primary-footer .footer-nav{display:table; padding-top:15px; margin:0px auto; border-top:1px solid #aaa; }
#primary-footer .footer-nav ul{ width:120px; min-width: 700px;}
#primary-footer .footer-nav li{display:inline; margin-right:15px;}

Open in new window

0
Comment
Question by:uescjp
  • 3
  • 2
  • 2
7 Comments
 
LVL 50

Expert Comment

by:Steve Bink
ID: 39823427
In your CSS, line 141 is overriding line 138.  Both hit the same target.  The rule below has greater specificity than both.
.footer-nav ul li a:link {
    color: #FFFFFF;
}

Open in new window

0
 
LVL 28

Expert Comment

by:chilternPC
ID: 39831276
if you look at the code of the footer on the home page  - its the same as the code for the rest of the joomla site - so I suspect the home page is not independent of the active template. it uses the same id's and classes as the other pages.

Note - although you can't see the link on the home page - Google and other search bots can and will find it which is important part.

if you want a different style page on the home page - create a new template  with your colours, install it and  configure the home page to use that and the other pages to use the existing template
0
 

Author Comment

by:uescjp
ID: 39848111
@routinet: I have tried that and the changes does not seem to have any effect.  Adding the ids of #home and #primary-footer changes the footer on all pages but I only want it changed on the front homepage.

@chilternPC: As you said, I only care for my sake.  I do not want to make multiple templates and switch between them for the frontpage and inner pages.  If it is not possible to only effect the front page with CSS then I will leave it as it is.
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 28

Accepted Solution

by:
chilternPC earned 350 total points
ID: 39848188
looking further into it, if you have joomla 3 you can specify a style sheet
for that page.
create the page specific style sheet. and upload it to somewhere on the site you know.

go to admin and click on menu manager. open the menu and find the home page menu item
click on that.
then click on the tab item called "Page Display".
on this page there is an entry "Page Class"   here you can specify that page specific style sheet.
not tried this myself , but the help says this is for adding styles to individual pages.
0
 

Author Comment

by:uescjp
ID: 39848202
chilternPC: That is seeming like the only option.  If noone else has any suggestions in the next few days I'll accept it as the answer but I will likely not do that either as it may be more hassle than it is worth.

Thanks
0
 
LVL 50

Assisted Solution

by:Steve Bink
Steve Bink earned 150 total points
ID: 39848290
I believe chilternPC's suggestions is your only route.  You could always use a Joomla extension designed to add a custom style sheet to pages, but I consider that the long way around to adding a page-level class and targeting that instead.

One correction, though: the "Page Class" attribute adds a *class* to the body, not a style sheet.  This means you still need to place the rules in your template's style sheet.
0
 

Author Closing Comment

by:uescjp
ID: 39848297
Not what I was hoping for but I understand the limitations of the version of Joomla I am using.  Thanks.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question