This is a migrated thread and some comments may be shown as answers.

Issue With The Way HTML Is Rendered

4 Answers 96 Views
SiteMap
This is a migrated thread and some comments may be shown as answers.
djhushd
Top achievements
Rank 1
djhushd asked on 19 Mar 2010, 02:56 PM
Im having an issue with the way the HTML is being rendered.

It seems to wrap the items in <UL> and <li> tags.

(see example)

 
     
 <div id="RadSiteMap1" class="RadSiteMap RadSiteMap_Default" StartingNodeOffset="0"
    <!-- 2009.3.1319.20 --><ul class="rsmList rsmLevel rsmTwoLevels"
        <li class="rsmItem"><class="rsmLink" href="/1.aspx">1</a><ul class="rsmList rsmLevel1"
            <li class="rsmItem"><div class="rsmTemplate"
                 
                       <href="/2a.aspx"
                            2a</a> 
                     
            </div></li><li class="rsmItem"><div class="rsmTemplate"
                 
                       <href="/2b.aspx"
 
                            2b</a> 
                     
            </div></li><li class="rsmItem"><div class="rsmTemplate"
                 
                       <href="/2c.aspx"
                            2c</a> 
                     
            </div></li><li class="rsmItem"><div class="rsmTemplate"
                 
                       <href="/2d.aspx"
                            2d</a> 
 
                     
            </div></li
 

For my CSS to work properly on my site map menu, i need to remove the LI and UL tags, so that it renders...

    <href="2.aspx">2</a> 
 
        <div> 
        <href="2a.aspx">2a</a> 
        <span class="qmdivider qmdividerx" ></span
        <href="2b.aspx">2b</a> 
        <span class="qmdivider qmdividerx" ></span
        <href="2c.aspx">2c</a> 
 
        <span class="qmdivider qmdividerx" ></span
        <href="2d.aspx">2d</a> 
        </div> 
 



4 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 17 Apr 2012, 09:20 PM
Hello,

Is there any way to do this? If not, is it possible to affect the css classes applied to each list item? We'd essentially like to be able to have:

<li class="rsmItem sfNoBreadcrumbNavigation newsItem"> News link </li>
<li class="rsmItem sfNoBreadcrumbNavigation contactItem"> Contact item </li>

but we could not find a way to put a CSS class on each generated <li>.

Thank you.
0
Kate
Telerik team
answered on 19 Apr 2012, 02:14 PM
Hi Chris,

You could use the CssClass property of the RadSiteMapNode that will apply the css class to the li element of the rendered html of the page:
<telerik:RadSiteMap ID="RadSiteMap1" runat="server" BackColor="#FFFFCC" Width="800px"
                ShowNodeLines="True">
                <Nodes>
                    <telerik:RadSiteMapNode runat="server" Owner="RadSiteMap1" Text="Workflows">
                        <Nodes>
                            <telerik:RadSiteMapNode runat="server" Owner="" Text="Eintrag 1" CssClass="new">
                            </telerik:RadSiteMapNode>
                    ....
</telerik:RadSiteMap>

Greetings,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Chris
Top achievements
Rank 1
answered on 20 Apr 2012, 02:52 PM
Hello,

The RadSiteNodes are coming from an external source; they are not declared in the markup. Is there any way to adjust the CSS class from within the template?

Thank you,
Chris
0
Kate
Telerik team
answered on 25 Apr 2012, 01:29 PM
Hello Chris,

One way to add your own css class without using the above suggested property is to use jQuery and append your own css class. You can refer to the following article on how this can be achieved:
http://api.jquery.com/addClass/

Greetings,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
SiteMap
Asked by
djhushd
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Kate
Telerik team
Share this question
or