How to check for self links?


(Denis Zarubin) #1

I want to remove self links.

 

I have something like this 

<MySource_AREA id_name="logo" design_area="show_if"> 
	<MySource_SET name="condition" value="asset_assetid" /> 
	<MySource_SET name="condition_status" value="XXXXX" />
	<MySource_THEN>Homepage. No need link</MySource_THEN>
	<MySource_ELSE>NOT home. Make link to homepage</MySource_ELSE>
</MySource_AREA>

The problem is that I am in a nested content of a header. So it returns the id of that nested (header) asset, but I need the root page id.

 

Comparing urls is not good for me, because links are flexible.

 

 

 

 


(Scott Hall) #2

Is your homepage quite complex and important e.g. a main part of your marketing/comms strategy? If so, might be better to divide and conquer, have a design file and templating system just for the home page. That way if there are significant changes for new campaigns they are isolated to the one design/page.


(Denis Zarubin) #3

No, it's quite simple so it has similar design of the header. The only thing I want to change is to remove self links on serverside.

 

 

BTW, same question about menu's. Conditions don't  work inside loops:

<ul class="list-group" id="nav">
	<MySource_AREA id_name="menu" design_area="menu_normal">
		<MySource_ASSET>
			<li><a class="list-group-item" href="<MySource_PRINT var='asset_link' />" data-type="%%"><MySource_PRINT var="asset_short_name" /></a> #<MySource_PRINT var='asset_type' />#
			#
				&lt;MySource_AREA id_name="logon_box2" design_area="show_if"&gt;
					&lt;MySource_SET name="condition" value="asset_type" /&gt;
					&lt;MySource_SET name="condition_types" value="Standard Page" /&gt;
						&lt;MySource_THEN&gt;page_standard&lt;/MySource_THEN&gt;
					&lt;MySource_SET name="condition_types" value="Redirect Page" /&gt;
						&lt;MySource_THEN&gt;Redirect Page : add some icon&lt;/MySource_THEN&gt;
				&lt;/MySource_AREA&gt;
			#
		&lt;/li&gt;
	&lt;/MySource_ASSET&gt;


	&lt;MySource_DIVIDER&gt;&lt;/MySource_DIVIDER&gt;
&lt;/MySource_AREA&gt;

</ul>


(Bart Banda) #4

hey Denis,

have you tried turning Remove self links to On? http://manuals.matrix.squizsuite.net/system-configuration/chapters/system-configuration#Search-Engine-Optimisations


(Denis Zarubin) #5

Remove self links

 

There are no control, it just delete. I need to replace it with other suitable code.


(Bart Banda) #6

Can you explain a bit more about the problem you are trying to fix? Are you simply just not wanting to print a link to the homepage around the logo image if the user is currently on the homepage?


(Denis Zarubin) #7

 Are you simply just not wanting to print a link to the homepage around the logo image if the user is currently on the homepage?

 

Yes.

 

And same issue with menu, I need to put <b>item</b> for current and <a href="/xxx/" class="selected">item</a> for parent link.


#8

Like breadcrumbs? Similar to that ? Sorry I just re read the post - that won’t help at all your using nested content.

Ignore me


(Bart Banda) #9

The logo show if might work if you use globals:

 

<MySource_AREA id_name="logo" design_area="show_if">    <MySource_SET name="condition" value="globals_asset_assetid" />
    <MySource_SET name="condition_status" value="XXXXX" />
    <MySource_THEN>Homepage. No need link</MySource_THEN>
    <MySource_ELSE>NOT home. Make link to homepage</MySource_ELSE>
</MySource_AREA>

 

?

 

But I don't think you can conditionally print the menu items like you are intending. You might be able to do something with modifiers on the menu print though, something like this?

 

<MySource_PRINT var="asset_type^eq:Standard Page:print something:something else" />


(Denis Zarubin) #10

Thanks for help, but nothing works:

 

1) I got an error "Condition globals_asset_assetid not found for asset "logo" design area [CORE0148]"

 

2) <MySource_AREA>  is not processed in nested content

 

 

Is it possible to use tags in this code?

<MySource_PRINT var="asset_type^eq:Standard Page:print something:something else" />  like

 

<MySource_PRINT var="asset_type^eq:Standard Page:<a href="%asset_link%">%asset_short_name%</a>:%asset_short_name%" />


(Bart Banda) #11

No, you can't use them like that. Maybe try using a globals keyword instead of a print tag, something like

%globals_asset_type^replace_keywords:eq:Standard Page:{asset_short_name_linked}:{asset_short_name}%