Top Menu Link to a Page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Hello:
I want to create a Top Menu Category and then when that is CLICKED to goto (link to) a site.

For example, I want to insert

<center><div id="vsscript_53655_408382"></div><script async type="text/javascript" src="https://app.viralsweep.com/vsa-widget-f87f3a-53655.js?sid=53655_408382"></script></center>

I tried at the "Category">Tools>source Code but it is not accepting this script

I thought I could insert a the File Manager level in the hosting.

Can someone point me to where that might be?

I have tried Views>common ....

Thanks!
4 years ago
Is there any error in console ?

If you are using theme than you have to put under theme pages.

If you want in header than you should go to header link page.
4 years ago
realdigital wrote:
Hello:
I want to create a Top Menu Category and then when that is CLICKED to goto (link to) a site.

For example, I want to insert

<center><div id="vsscript_53655_408382"></div><script async type="text/javascript" src="https://app.viralsweep.com/vsa-widget-f87f3a-53655.js?sid=53655_408382"></script></center>

I tried at the "Category">Tools>source Code but it is not accepting this script

I thought I could insert a the File Manager level in the hosting.

Can someone point me to where that might be?

I have tried Views>common ....

Thanks!


Your question is not clear to me. Do you want to insert script as category description text? If yes, then go to Configuration 》 Settings 》 All settings . Search adminareasettings.richeditorallowjavascript setting and set value equal true.
4 years ago
realdigital wrote:
I want to create a Top Menu Category and then when that is CLICKED to goto (link to) a site

External site? The most easy way it would be by hardcode cshtml file. TopMenu is located at the /Shared/Components/TopMenu/Default.cshtml

Regards,
Tom
4 years ago
thank you Tom, that is where I was looking for.

So I went to configuration>settings>All Settings (advanced)

and created a new record "sweepstakes" = true

Then on the /Shared/Components/TopMenu/Default.cshtml

I insert below
    @if (Model.DisplayHomePageMenuItem)
    {
        <li><a href="@Url.RouteUrl("HomePage")">@T("HomePage")</a></li>
    }

THIS
<li><a href="www.LINK.com("Sweepstakes")">@T("Sweepstakes")</a></li>


would this be correct? Or, where should I insert?

thanks for the help!
4 years ago
realdigital wrote:
So I went to configuration>settings>All Settings (advanced)

and created a new record "sweepstakes" = true

No need to create new record, in case of hardcode link.

realdigital wrote:
<li><a href="www.LINK.com("Sweepstakes")">@T("Sweepstakes")</a></li>

Just add
<li><a href="www.LINK.com">@T("Sweepstakes")</a></li>

@T inside of "a" element may be used to made quick change of displayed name (just edit language pack to change, only loggin to admin panel). If you do not want to change displayed name, may add just text like
<li><a href="www.LINK.com">LINKNAME</a></li>


Regards,
Tom
4 years ago
That worked great Tom.

Thanks!

I placed after:

...
<ul class="top-menu">
    @await Component.InvokeAsync("Widget", new { widgetZone = PublicWidgetZones.HeaderMenuBefore })
    @if (Model.DisplayHomePageMenuItem)
    {
        <li><a href="@Url.RouteUrl("HomePage")">@T("HomePage")</a></li>

    }
<li><a href="http://sweepstakes.myrealmobile.com/">Sweepstakes</a></li>[/u]
    @{
        var rootCategories = Model.Categories.Where(x => x.IncludeInTopMenu).ToList();
    } .....

It shows up as the FIRST option on the Menu (which is OK)

If I wanted to move it further along the MENU (further right)what should I do?

thanks
4 years ago
To move it somewhere else, just need to move that piece of code to specify place. Please note, some items are in loop (like categories), so this kind of customization will not work if you would like to place it between categories. But after or behind you may do easily.

Regards,
Tom
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.