Anyway to only Display Main Catagory on front page?

Last post 09-03-2007 12:45 PM by Imageco. 4 replies.

Sort Posts:

  • Anyway to only Display Main Catagory on front page?

    06-22-2007, 10:42 PM
    • Member
      point Member
    • wsterntime
    • Member since 06-23-2007, 2:37 AM
    • Posts 2

    I was wondering if there is any way to display only the main catagories on the front page and then have the subcatagories show up after clicking on the main page. My front page looks too jumbled showing all the sub catagories. Thanks for any help. Big Smile

  • Re: Anyway to only Display Main Catagory on front page?

    06-23-2007, 7:09 AM
    • Member
      710 point Member
    • Nitinkcv
    • Member since 03-13-2007, 11:07 AM
    • Posts 264

     Hi,

     Im not sure if i get you properly. But have a look at this:

     code for aspx 

     <div runat="server" id="MainCategory1" onclick="show(this.id)" >Click here to show more details on this </div> 

     <div runat="server" id="MainCategory2" onclick="show(this.id)" /> Click here to show more details on this </div>

     <div runat="server" id="MainCategory3" onclick="show(this.id)" />Click here to show more details on this </div> 

     <div runat="server" id="MainCategory4" onclick="show(this.id)" />Click here to show more details on this </div> 

     <div runat="server" id="MainCategory5" onclick="show(this.id)" />Click here to show more details on this </div> 

    <div runat="server id="MainCategory1_subcategory" style="visibility: hidden;">write your stuff </div>

    <div runat="server id="MainCategory2_subcategory" style="visibility: hidden;">write your stuff </div>

    <div runat="server id="MainCategory3_subcategory" style="visibility: hidden;">write your stuff </div>

    <div runat="server id="MainCategory4_subcategory" style="visibility: hidden;">write your stuff </div>

    <div runat="server id="MainCategory5_subcategory" style="visibility: hidden;">write your stuff </div>

     JavaScript

     function show(id)
    {
     
      var idname= id;
      if(idname=="MainCategory1")
      document.getElementById('MainCategory1_subcategory').style.visibility='visible';

     else if(idname=="MainCategory2")
      document.getElementById('MainCategory2_subcategory').style.visibility='visible';

     else if(idname=="MainCategory3")
      document.getElementById('MainCategory3_subcategory').style.visibility='visible';

    }

     

    This is just an outline. PLease let me know if you have any queries
     

      

    Thanks
  • Re: Anyway to only Display Main Catagory on front page?

    06-23-2007, 8:21 AM
    • Member
      point Member
    • wsterntime
    • Member since 06-23-2007, 2:37 AM
    • Posts 2

     Hi,

    Thank you for your response. I am totally new to this and am not sure where I would put this code you have given.

  • Re: Anyway to only Display Main Catagory on front page?

    06-23-2007, 8:50 AM
    • Member
      710 point Member
    • Nitinkcv
    • Member since 03-13-2007, 11:07 AM
    • Posts 264

     Hi,

     If you were planning a simple html page please see the followingcode:

     

    <html>
    <head>
    <script type="text/javascript">
    function show(id)
    {

    var idname= id;
    if(idname=="MainCategory1")
    document.getElementById('MainCategory1_subcategory').style.visibility='visible';

    else if(idname=="MainCategory2")
    document.getElementById('MainCategory2_subcategory').style.visibility='visible';

    else if(idname=="MainCategory3")
    document.getElementById('MainCategory3_subcategory').style.visibility='visible';

    }

    </script>
    </head>

    <body>
    <div id="MainCategory1" onclick="show(this.id)" >Click here to show more details on this </div>

    <div id="MainCategory2" onclick="show(this.id)" /> Click here to show more details on this </div>

    <div id="MainCategory3" onclick="show(this.id)" />Click here to show more details on this </div>

    <div id="MainCategory4" onclick="show(this.id)" />Click here to show more details on this </div>

    <div id="MainCategory5" onclick="show(this.id)" />Click here to show more details on this </div>

    <div  id="MainCategory1_subcategory" style="visibility: hidden;">write your stuff </div>

    <div id="MainCategory2_subcategory" style="visibility: hidden;">write your stuff </div>

    <div id="MainCategory3_subcategory" style="visibility: hidden;">write your stuff </div>

    <div id="MainCategory4_subcategory" style="visibility: hidden;">write your stuff </div>

    <div id="MainCategory5_subcategory" style="visibility: hidden;">write your stuff </div>
    </body>

    </html>

     Please let me know.

    Thanks
  • Re: Anyway to only Display Main Catagory on front page?

    09-03-2007, 12:45 PM
    • Member
      2 point Member
    • Imageco
    • Member since 09-03-2007, 10:44 AM
    • Posts 1

    Hi,

    I was looking for a way to do something very close to this.  The main difference is, as you select one option, I would like the previous options to be hidden again.  In other words, so only one option shows up at a time.  Is there a way to alter this code to do that?  Thanks in advance!

Page 1 of 1 (5 items)