21287 Posts in 5733 Topics by 2603 members
| Go to End | Next > | |
| Author | Topic: | 1172 Views |
-
Adding Hyperlink to another site from SilverStripe

22 July 2011 at 5:47am
How can I add a link to another website from a StripeSite had have it show up in the navigation. The current code for Navigation.ss in Themes>tlmweb>templates>Includes is
<div id="navigation">
<div id="topnav">
<div id="links">
<ul>
<% control Menu(1) %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle.XML</span></a></li>
<% end_control %>
</ul>
</div>
<div id="arrow_container"><div id="top_arrow"></div></div>
</div>
<hr>
<div id="subnav">
<div id="arrow_container"><div id="sub_arrow"></div></div>
<div id="links">
<ul>
<% control Menu(2) %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle.XML</span></a></li>
<% end_control %>
</ul>
</div>
</div>
</div><!-- END NAVIGATION -->I want to add a link called "Gallery" to point to http://www.site.com (obviously not the link, but for coding only - I can replace it with the correct link)
I have been told this is where to do the changes but I have tried all of the placements of the html code and it doesn't show up on the site.
Also, (this because I am new to SilverStripe) there is another theme called blackcandy in the theme folder and it has a Navigation.ss - but I assume (I know) that the change has to be made in the theme that applies to the site - or is the site theme built on blackcandy. Not sure how the structure of SilverStripe works.
I have tried to search the SilverStripe site and forums for help but can't find the answer so please help and if you can please actually give the correct code to use.
thanks
Sue -
Re: Adding Hyperlink to another site from SilverStripe

22 July 2011 at 7:00am
Sue, just place the link just outside <% control Menu() %> block but before the </ul>. You have to flush the cache after you make the change for it show up. Just add ?flush=1 to the end of the URL in your browser. So http://www.site.com/my-page/?flush=1
-
Re: Adding Hyperlink to another site from SilverStripe

22 July 2011 at 7:07am
Hello again - thanks!
I missed the flush step - so I'll try again. Does this just get done on the one theme or is it possible that themes are built on another?
Sue
PS got the gallery set up by doing a c name (ie www.gallery.mysite.com)!
-
Re: Adding Hyperlink to another site from SilverStripe

22 July 2011 at 7:16am
Each theme in the themes directory is a standalone theme. In SS2.3 you set the theme in mysite/_config.php
-
Re: Adding Hyperlink to another site from SilverStripe

22 July 2011 at 7:24am
Got it! it was the flush that I didn't know about. Now I am on my way to getting the job done and it is only with your help that I got to this point.
Sue
-
Re: Adding Hyperlink to another site from SilverStripe

26 July 2011 at 4:48am
That worked perfectly. Now how do I hard code a link in the site map??
Sue
-
Re: Adding Hyperlink to another site from SilverStripe

26 July 2011 at 5:01am
Well you can add <li><a href="http://gallery.mysite.com" title="Go to the Gallery" class="Link"><span>Gallert</span></a></li> outside one of the <% Menu %> control bloack or you can add a new Redirector Page to your site via the CMS
-
Re: Adding Hyperlink to another site from SilverStripe

26 July 2011 at 5:04am
That sounds like what I did on the navigation.ss in the theme - I now need to add this to the site map - what file creates the site map?
| 1172 Views | ||
| Go to Top | Next > |


