Self referenceing Canonical rel [Solved] |
Post Reply ![]() |
Page 12> |
Author | |
hunnypuppy ![]() Newbie ![]() Joined: Aug 03 2023 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() Posted: Nov 19 2023 at 1:57pm |
Is there any way to configure open element to automatically include a self referencing Canonical rel link in the page header for each page?
If not, how does one do it? Also, is there a way to automatically have the domain component of the Canonical rel inserted at runtime (e.g. if I'm using an IIS ASPX to host it) so that if the hosting domain changes the Canonical rel is still valid when the page is delivered by IIS.
Edited by Hobby001 - Dec 06 2023 at 7:38pm |
|
![]() |
|
Hobby001 ![]() Admin Group ![]() ![]() Joined: Jun 05 2018 Location: Canada, Québec Status: Offline Points: 6145 |
![]() ![]() ![]() ![]() ![]() |
If you look on top of the working area, you have the current language button the the source code button.
Click on source code button a code edition screen will appear. Click on the Plus sign, add a name for fututr reference, select Html, select Header Add your preferred code like:
Edited by Hobby001 - Nov 19 2023 at 5:04pm |
|
![]() |
|
Hobby001 ![]() Admin Group ![]() ![]() Joined: Jun 05 2018 Location: Canada, Québec Status: Offline Points: 6145 |
![]() ![]() ![]() ![]() ![]() |
@hunnypuppy
Any feed back on this topic?
|
|
![]() |
|
Hobby001 ![]() Admin Group ![]() ![]() Joined: Jun 05 2018 Location: Canada, Québec Status: Offline Points: 6145 |
![]() ![]() ![]() ![]() ![]() |
No feed back, closing topic
|
|
![]() |
|
hunnypuppy ![]() Newbie ![]() Joined: Aug 03 2023 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
Sorry the delay, that was very helpful. This is what I finally ended up adding in the Header -> HTML code snippet for a ASP.NET server on the main landing page. This would automatically insert the domain ending with a / as the self referencing canonical.
I would need to now modify this to include the page name for each page that I create through OpenElement for each page to have their own self referencing canonical link. The problem though is that if I change the name of the page I will need to remember to update the code snippet on the page. It would be awesome if OpenElement can have an option automatically include the self referencing canonical code in the page header and then update it when the page name changes through OpenElement.
|
|
![]() |
|
Hobby001 ![]() Admin Group ![]() ![]() Joined: Jun 05 2018 Location: Canada, Québec Status: Offline Points: 6145 |
![]() ![]() ![]() ![]() ![]() |
Of course it would be interresting.
You can automate it using javascript. Give me two examples of script ( two different pages ) |
|
![]() |
|
hunnypuppy ![]() Newbie ![]() Joined: Aug 03 2023 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
Sorry I didn't understand what you're asking for. Are you asking me for a script? I don't have any.
I was just asking if it's possible to include a check box or option in the page setting to automatically include the canonical code based on the website address entered in openelement and then update that automatically when the page is renamed.
|
|
![]() |
|
Hobby001 ![]() Admin Group ![]() ![]() Joined: Jun 05 2018 Location: Canada, Québec Status: Offline Points: 6145 |
![]() ![]() ![]() ![]() ![]() |
You can use a layer for that.
Let's assume that you are currently using the default Base layer in your project containing multiple pages Second assumption, you do not want your script on every pages but on many of those. Here is the solution
It is not going to be a check box but a simple layer selection. The reason to keep the base layer assigned to the canonical layer is to maintain any existing set-up previously made to the project troughout the base layer. |
|
![]() |
|
Hobby001 ![]() Admin Group ![]() ![]() Joined: Jun 05 2018 Location: Canada, Québec Status: Offline Points: 6145 |
![]() ![]() ![]() ![]() ![]() |
For more information on layers, https://denislafrance.net/index.en.php#formation
|
|
![]() |
|
Hobby001 ![]() Admin Group ![]() ![]() Joined: Jun 05 2018 Location: Canada, Québec Status: Offline Points: 6145 |
![]() ![]() ![]() ![]() ![]() |
By the way, I an not familiar with ASP.net.
I needed to get more info on it to understand your script. If you have any other question of this kind, explain your code so helping you will be easier. Edited by Hobby001 - Nov 28 2023 at 11:18am |
|
![]() |
Post Reply ![]() |
Page 12> |
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |