MODX Community

I have this [[++site_start]] in my code and need some help

I am trying the change an element on my home page navbar and although I can change the resource number, it doesn’t change on my page, because I have this [[++site_start]] before the resource numbers.

[[pdoResources?
			&parents=`0`
			&limit=`0`
			&resources=`[[++site_start]],14,6,663,628,15`
			&sortby=`resources`
			&tplWrapper=`@INLINE {{+output}}`
			&tpl=`mainMobileRow`
			]]

On another website, it doesn’t have the [[++site_start]] and if I change the resource it automatically changes the front page

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

All I want to do is change the resource number to point to a new resource page.

Any thoughts, if that makes sense?
Thanks

Kyle

[[++site_start]] is just a variable for the resource-id of your homepage.
You can change the value if you click the cog-wheel icon in the upper right corner of the menu bar and choose ‘System Settings’. Then enter site_start into the ‘Search by key…’-field.

If you don’t want to change the homepage you can also just replace the value [[++site_start]] in the pdoResources-call with a fixed number.

Hi Harry,

really appreciate that. a couple of question, now I think I understand that it is an id of my homepage. As I have multiple resources, I cannot replace with 1 number so;
Is it a necessity to have [[++site_start]] in the coding?
What are the consequences of removing [[++site_start]] from the code?
Because I cannot understand that when I change a resource number, why it doesn’t change on the website?

Still learning so I highly appreciate any advice or guidance

Thanks

Let’s say the resource-id of your homepage is 1.
Then this line

&resources=`[[++site_start]],14,6,663,628,15`

is equivalent to this line

&resources=`1,14,6,663,628,15`

You just lose the flexibility, that if you change the resource-id of your homepage, it won’t automatically change your navigation.

hi, that makes sense and fully understandable, just concerned to remove [[++site_start]] and change to homepage number, because I am not fully aware if it will impact the site anywhere else.
What I do not understand is that when I change the resource number, it will not change on the front end? it must be some other restriction or I need to change something else. or is [[++site_start]] a fixed parameter and anything after stays as is… I am slightly confused :neutral_face:
thanks for you support though :+1:

“just concerned to remove [[++site_start]] and change to homepage number” This would be perfectly fine, [[++site_start]] is just a variable for your homepage ID, so that home shows up in your navigation. But i don’t think thats the problem here, it sounds more like a cached snippet. Try clearing your cache or make the snippet call uncached by placing an ! after the opening [[

ex:
[[!pdoResources? &parents=`0` &limit=`0` &resources=`[[++site_start]],14,6,663,628,15` &sortby=`resources` &tplWrapper=`@INLINE {{+output}}` &tpl=`mainMobileRow` ]]

Just a thought. In the code there is this line:

&tpl=`mainMobileRow`

So maybe this navigation is only visible on smartphones.
Maybe nothing changes on the frontend because you are looking at the wrong navigation.

2 Likes

Hi guys,

This is what is weird?!

In the chunk, code it states 663 Customised Training

but when you look at the front end it shows the wrong resource

I have cleared cache and added the ! as suggested

I also changed another resource and that didn’t change either.

I’ve attached a file but feel I am a bit stumped :thinking:

thanks

Check your source code in the browser. Are there two different <nav>-elements?

<nav class="main-nav">...

for the main navigation and

<nav id="nav" class="mnav">...

for the navigation on mobile devices.

If you change the navigation for mobile devices, you should reduce the width of your browser window so this navigation becomes visible.

1 Like

ok, this is what i have. Both in the script

Thanks

If you look at the code on the right side of your screenshot, 7 rows above the marked line, there is another <nav>-element.
The changes you make change that navigation.

Does 663 have “hide from menus” checked?

Also, since no one mentioned it specifically. The page that gets filled in for [[++site_start]] is defined in the System Settings: Core: Site. So if you are wanting to change the actual home page that people see when they first visit the site, that is where you would change that to point to another page. Then that new page would automatically become the first menu item.

1 Like