Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Displaying a Image based on its top-level root tabidDisplaying a Image based on its top-level root tabid
Previous
 
Next
New Post
8/5/2008 12:57 PM
 

Hello uber programmers!

I like to display a specific image on a page based on "its top-level root tabid". 

Play (Root page - tabid=23)
-- Slide
-- Swing
-- Pool
Yummy (root page - tabid=34)
-- How to Eat
-- How to swallow
-- Things you can't eat

I would like to display a "Kids" image on all pages under "Play" including Play, slide, swing, and pool page. I also would like to display a "Fruits" image under "Yummy" including Yummy, how to eat, how to swallow, and things you can't eat page.

I read the manual, googled it, of course searched this forum.... no luck so far. I am guessting it's something to do with "IntStartTabID" but i am not sure. Once I find a way to identify the "Root TabID", i can just send the variable to an external javascript code and replace the image on the page. (if tabid=32 then replace the image on the page with that image....,,, if tabid=43 then use this image...).  it's not dynamic solution but  the number of top level items are only 5 or 6......I was also thinking to create 6 skins for all root menus and do "Copy design to descendants" in admin setting. But... it's not my favorite solution.....Hmmmmmmm I am stuck.

ANYWAY, do you know any way to make it work without putting a little javascript on every single page to specify the image? or, do you know any modules does the similar job I want? or even a hint?

Thank you!

 
New Post
8/13/2008 2:38 PM
 

Ok. no one was helping me(*SOB*)  so I figured it out by myself

 

ON YOUR SKIN FILE (.ascx)

<Img src="" id="SwapThisImage">

<script language="JavaScript">
<!--

//Where is the image folder?
var SkinImgPath = '/Portals/_default/Skins/MySuperBlueSkin/Images/';

// get root tabid
 var AncestorID = <%= PortalSettings.ActiveTab.ParentId %>;
 
// if the tab is root tab, it will return "-1" as tabid, we don't want that -  just get a current tabid. 
 if(AncestorID==-1){
  AncestorID = <%= PortalSettings.ActiveTab.TabID %>;
 }
 
//dump the ancestorID to imageswapper function
ImageSwapper(AncestorID);

function ImageSwapper(AncestorID){

var ImgName ="Default.jpg"

switch(AncestorID)
 {
  case 23: // Tabid for tab "Play"
   ImgName = "Kids.jpg";
   break;

  case 24: // Tabid for tab "yummy"
   ImgName = "Fruits.jpg";
   break;

  default:
   ImgName = "Default.jpg";
 }

//swap image
 document.getElementById('SwapThisImage').src = SkinImgPath+ImgName';

}
//-->
</script>

I don't like the inside of switch statement. it's not dynamic solution but I can live with it.

 

 

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Displaying a Image based on its top-level root tabidDisplaying a Image based on its top-level root tabid


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out