TinyPortal

Development => Support => Topic started by: Applebomb on November 07, 2007, 08:04:52 PM

Title: How do I get on-click links working in the Sitemap?
Post by: Applebomb on November 07, 2007, 08:04:52 PM
Hello everyone!

I am wanting to implement something on my website (http://www.furycentral.net) that I have seen on another website (http://www.mmo-champion.com)

On mmo-champion in their Sitemap section, they have on click links. Example: If you click Farming, it "opens" up another block of information with actual links to php pages.

My question is where would I go to add this into my website?  I have looked all through the sitemap section in admin and I can't seem to find anything relevant to what I am trying to do.

So am I going to need to modify some already existing files manually, and if so which files would I modify to be able to do this?

Thanks for any help!

-Applebomb
Title: Re: How do I get on-click links working in the Sitemap?
Post by: Nokonium on November 07, 2007, 08:12:19 PM
If you look in the Block Manager then click on the Menu Manager tab you will see that the last but one column is a checkbox for the sitemanager block. You can also use the Menu Manager to create a block with links to a wide range of things.
Title: Re: How do I get on-click links working in the Sitemap?
Post by: Applebomb on November 07, 2007, 08:15:49 PM
Quote from: nokonium on November 07, 2007, 08:12:19 PM
If you look in the Block Manager then click on the Menu Manager tab you will see that the last but one column is a checkbox for the sitemanager block. You can also use the Menu Manager to create a block with links to a wide range of things.

I know all of that, but it still doesn't help me with my problem :)

I know I can set something to a "link" but how do I go about turning that "link" into a dead link that does nothing but open a <div id> submenu within the sitemap itself, as done on mmo-champion.com ?
Title: Re: How do I get on-click links working in the Sitemap?
Post by: Nokonium on November 07, 2007, 08:35:56 PM
Links isn't the only option for a menu item.

Title: Re: How do I get on-click links working in the Sitemap?
Post by: Applebomb on November 07, 2007, 08:43:37 PM
Quote from: nokonium on November 07, 2007, 08:35:56 PM
Links isn't the only option for a menu item.



Heh, I know all of this already.  Just look at http://www.mmo-champion.com

The sitemap on mmo-champion is using a "dead link" to open a div id submenu.
Title: Re: How do I get on-click links working in the Sitemap?
Post by: Nokonium on November 07, 2007, 08:46:51 PM
That isn't currently included in TP menu's.
Title: Re: How do I get on-click links working in the Sitemap?
Post by: Applebomb on November 07, 2007, 08:50:52 PM
Quote from: nokonium on November 07, 2007, 08:46:51 PM
That isn't currently included in TP menu's.

Any idea which file(s) I would go about modifying so that I can manually insert the needed code?
Title: Re: How do I get on-click links working in the Sitemap?
Post by: Nokonium on November 07, 2007, 11:30:30 PM
Currently, no.

But someone else may be able to help.
Title: Re: How do I get on-click links working in the Sitemap?
Post by: Applebomb on November 07, 2007, 11:49:39 PM
Quote from: nokonium on November 07, 2007, 11:30:30 PM
Currently, no.

But someone else may be able to help.

Thanks for the attempted help.

Does anyone else have any idea how I would go about doing this?

P.S. I have e-mailed the admin at mmo-champion but haven't received a reply yet.
Title: Re: How do I get on-click links working in the Sitemap?
Post by: IchBin on November 08, 2007, 12:03:47 AM
I would advise you not to alter the TP files. What I would suggest is that you use a custom script. If you can get the mmo one, then great. Otherwise, there are TONS of scripts you can find via a google search. There's a similar one in the block code snippets board that does a slide affect.
Title: Re: How do I get on-click links working in the Sitemap?
Post by: Applebomb on November 08, 2007, 07:45:31 AM
Hey guys!

I'm back, and this time with some good news  ;D

I started playing around with scriptboxes and some scripts that I found and I have come up with EXACTLY what I was trying to do.

Found this code on dynamicdrive.com and it basically makes it function just as I wanted.

Create a scriptbox and insert the following in it:

Quote<script type="text/javascript">

/***********************************************
* Contractible Headers script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated Mar 23rd, 2004.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags.className==classname)
ccollect[inc++]=alltags
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents).style.display="block"
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate

</script>
<h3 onClick="expandcontent('sc1')" style="cursor:hand; cursor:pointer">What is JavaScript?</h3>
<div id="sc1" class="switchcontent">
JavaScript is a scripting language originally developed by Netscape to add interactivity and power to web documents. It is purely client side, and runs completely on the client's browser and computer.
</div>

<h3 onClick="expandcontent('sc2')" style="cursor:hand; cursor:pointer">Difference betwen Java & JavaScript?</h3>
<div id="sc2" class="switchcontent">
Java is completely different from JavaScript- the former is a compiled language while the later is a scripting language.
</div>

<h3 onClick="expandcontent('sc3')" style="cursor:hand; cursor:pointer">What is DHTML?</h3>
<div id="sc3" class="switchcontent">
DHTML is the embodiment of a combination of technologies- JavaScript, CSS, and HTML. Through them a new level of interactivity is possible for the end user experience.
</div>

Apparently scriptboxes can also load portions of code that would go in the head section of an html document independently of an actual document.

Hopefully this will help you guys out with whatever you may be trying to do as well!

Thanks for the help!
Title: Re: How do I get on-click links working in the Sitemap?
Post by: Zetan on November 08, 2007, 11:04:13 AM
Theres a topic called Acordian Style Menu.. or summink.
A search should find it.. similar to what you have found.