If i find something in inspect, where can i locate it in modx so that i can edit my homepage

I have a section on my homepage, a NAV bar, I can see it on INSPECT but do not know how to locate in MODX?
Any suggestions?
Thanks

1 Like

That completely depends on how the site was built.

Typically, you’d first find the resource. In this case the homepage, so it’s probably one of the first resources in the resource tree.

On that resource you can check the content and the template variables. You’ll also see the template the page uses.

Open the template next; from the Elements > Templates tabpanel on the left.

It’s possible all the HTML and snippet calls are in there, or that the template is further subdivided into [[$chunks]]. If that’s the case you can dig deeper into the chunks.

Some sites are more structured than others, and there are some complex template systems out there too that make it harder to track down specific elements. If you get stuck, I’d recommend getting in touch with who built your site.

1 Like

Hi MarkH,
thats great! i seem to have located it, or the are i want to try and edit, buit alas as you said it must be hidden in chunks… I found the code, and when i search in the code for the nav bar, it has
div class=“wrap-main-nav”>


[[pdoResources?
&parents=0
&limit=0
&resources=14,6,45,659,15
&sortby=resources
&tplWrapper=@INLINE <nav class="main-nav">{{+output}}</nav>
&tpl=MainMenuItem
]]

I imagine it is deeper. So will search on.

Have contacted the person who built the site, they are taking an age to get back to us, so i am using my limited knowledge on a staged site to see if i can fine the code.

Really helpful though,

thank you very much.

&tpl=MainMenuItem

You should find the code for each navigation item in a chunk called MainMenuItem

awesome, i see it. I checked and all thats in the chunk is:

<a class=“item” href="[[~[[+id]]]]" [[+attributes]]>
[[+menutitle:default=[[+pagetitle]]]]

So more digging :cowboy_hat_face:

Thanks

These fields should all be defined on the resource itself.
What exactly are you trying to change?

Hi,
i am trying to change/add a to the nave bar, but cannot locate it on the back end

probably going the wrong way round it, but am learning things in the process. maybe need to find a modx course :+1:

thank you very much for your help

If you want to add or remove items from the menu, you have to change it here in the &resources-property.

[[pdoResources?
...
&resources=14,6,45,659,15
]] 

&resources = Comma-separated list of resources to add to the results.

If you want to change the name that is shown, you need to change the field menutitle in the resource.

I’m getting closer, I duplicated/created a new resource.
went into the chunk


removed 659 added 662 and it removed 659 from the home page
but didn’t add it to the nav bar.

Further investigation :clap:t2:

In your new resource:
Is the checkbox Published checked?
Is the checkbox Hide From Menus unchecked?

1 Like

:rofl: :joy: yes!
that’s brilliant,
i will now be able to get somewhere,
Thank you ever so much!!

Can give a referral or anything?

1 Like