When using components I am getting broken links all over the place.
My component is a main menu. It is defined in a masterpage at the root level. If I link to a page in another directory, it uses the relative URL from the masterpage. This works fine as long as all the pages it is used on are also at root level.
But when I put this on a page that is not in the root level (in a folder) the links are all messed up. Each link in the component is treated as if the page the component is on is in the root level.
I can fix this be going to each page and clicking on ‘Fix Links’ but this is hardly a solution as the next time I update that component I will have to click ‘Fix Links’ on each page in my site.
Is this a known bug or am I doing something wrong?
Yes, I did follow that tutorial. One thing that detracts from the usefulness of components is the need to save each page afterwards when you have a very large site. Even with ten pages you have to open them all just to save them.
Imagine when I have hundreds and they are hidden in sub-folders.
P.S. I use MAMP to render my JS included pages…because PG doesn’t seem to do this, yet.
in the above diagram I have already manually corrected the first two image paths as they too, didn’t show up.
As you can see, PG uses this whole Add resources to Library thing from Project A, for the component library-but then DOESNT actually seem to add this actual resource link to the New, Project B! - it doesnt add the correct path.
So I think the solution is for the PATH to include the Library Assets of Project B in project A as, currently, it doesnt.
that is /components/whateverproject/css, and the same for images, js, whatever.
I get the idea of adding the project A library in a separate component directory in B to prevent conflicts! this is CLEVER
however, you still have to MANUALLY prepend /components/cards/ to each resource directory you use from Project A into Project B.
The current fudge solution is to not amend the path as above, but rather to copy all relevent Project A css files to css folder, js to js folder etc etc. However, that means, if your using PROJECT A as a library in 10 projects… every time you change a component in A, you have REMEMBER which projects used A as a library and go and manually copy the files again! EEK! not scalable.
now, am I doing this correctly or is this a bug?
so if you add projects as a library and then every thing goes KaBoOoOM!
check this out and see if it helps until this bug is addressed
And here is the correct path for the cards block kit, if added via Use Project as a Library
to alphabetical order I think, and so you loose the CSS cascade and so again, manually have to go back and look at and compare project A order, then reorder them in Project B to be the same. - thats after you have had to manually edit the /component/ css library path if it doesnt seem to map.
Here is a link to what I just posted with regards this in on our forum
there you go.
if Im doing it wrong, please correct me
But I dont seem to be alone. So, thanks @Simmo, as if you hadnt said that you too, were finding it impossible and too much like hard work to get them to work, as well, then I wouldnt have burrowed to the bottom of this!
As I too, gave up… and just hoped V3.0 would make it easier! not realising it might be bust!
But, how come, NO ONE ELSE, worked this out? or were more vocal.
I think we need a BUG topic on our forum too. … as I can no longer post on Slack (unless we get irc gateway added) and, after all, I WAS the Champion Bug buster for a while… pretty sure I lost that title a few times over now though
This is why I never used components or libraries, as I thought I was confused and couldn’t get them to work.
Maybe it was my tool of choice that failed me though!
I will try again in a bit, as I have a show this weekend !
In Swansea Leisure Centre, South Wales. if you’re about, pop in