I've been using the articles parent and article child in some of my pages in my website, everything works perfectly, except for the linking to the pages.
As I'm adding the same item in other of my pages, and I dont want to create new child arcticles (because they would be duplicated), Im redirecting through href to the page I select in "Content Picker". But somehow the link on the href doesnt correspond to the one I select on the backend. Why is this happening? How can I solve it?
So instead of using <a href="@post.Url">im using <a href="@page.linkToOtherPage"> but somehow it seems that this href gets overwritten.
so whats happening is that I have a page with a set of items, each one of this items have a detailed page of their own. And this list page is the parent, and when I click in each item its suppose to redirect to the correspondent child page. But I want to add these items in other of my pages, and redirect them to those child pages, but i dont want to create new ones, so I was using Content Picker and then user href to redirect it to the page I select on content picker. However I noticed that the URL is not right, instead of having something like .../page1/item1, it has .../1572, so its like its not picking up right the page node I select on content picker. I worked with this a few weeks ago and everything was working fine till now.
Do you have any idea about whats happening?
I also noticed that when it comes to external links (http://www.google.com for example) it works fine, it just doesnt work with content picker.
Thank you very much!
I really need to fix this bug, but really dont know whats causing this.
Seems like you're getting the id from the content picker and then you'll need to use a method for getting the url based on that id.
But it's hard to advice you in your current context without being able to see the full code you're working on it would be nice if you could provide a full sample of it :)
Parent Child articles with links to other pages
Hello,
I've been using the articles parent and article child in some of my pages in my website, everything works perfectly, except for the linking to the pages. As I'm adding the same item in other of my pages, and I dont want to create new child arcticles (because they would be duplicated), Im redirecting through href to the page I select in "Content Picker". But somehow the link on the href doesnt correspond to the one I select on the backend. Why is this happening? How can I solve it?
So instead of using
<a href="@post.Url">
im using<a href="@page.linkToOtherPage">
but somehow it seems that this href gets overwritten.Please help!
Thank you!
Nelson,
Can you provide examples of current and expected output? And probably explain a bit more how things have been set up in cms?
--Dirk
Hello Dirk,
so whats happening is that I have a page with a set of items, each one of this items have a detailed page of their own. And this list page is the parent, and when I click in each item its suppose to redirect to the correspondent child page. But I want to add these items in other of my pages, and redirect them to those child pages, but i dont want to create new ones, so I was using Content Picker and then user href to redirect it to the page I select on content picker. However I noticed that the URL is not right, instead of having something like .../page1/item1, it has .../1572, so its like its not picking up right the page node I select on content picker. I worked with this a few weeks ago and everything was working fine till now. Do you have any idea about whats happening?
I also noticed that when it comes to external links (http://www.google.com for example) it works fine, it just doesnt work with content picker.
Thank you very much! I really need to fix this bug, but really dont know whats causing this.
Hi Nelson
Can you provide the full source code for this?
Seems like you're getting the id from the content picker and then you'll need to use a method for getting the url based on that id.
But it's hard to advice you in your current context without being able to see the full code you're working on it would be nice if you could provide a full sample of it :)
/Jan
Hello Jan,
yes I just figured out that's exactly whats happening! Im getting the id from the content picker, how can I find out the url through the page id?
Thank you very much! Very appreciated!
Hi Nelson
I would prefer seeing your full code but you should be able to get the full url from the id by using the NiceUrl() method, which you can see here https://our.umbraco.org/documentation/Reference/Querying/UmbracoHelper/
So something like
Should to the trick.
Hope this helps.
/Jan
Thank you very much! That did the trick!
is working on a reply...