Pinegrow Community Support Forum

Broken links in components

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?

Thanks for the help.

I’ve encountered the same thing but figured I just didn’t know enough yet. I have hundreds of pages and folder levels that go up to five levels deep.

Now I’m afraid to update components for fear they will revert to a broken status.

I’ve even resorted to using full urls rather than internal links.

Hopefully someone will shine some light on our darkest fears or lack of knowledge.

@msavard @Farscaper this is from the documentation “How to reuse the same menu component on multiple pages” and it might be helpful.

"Updating the menu

Now, whenever we need to change the menu we just do the change on the main page where the component is defined and use Component -> Update to apply the change to all component instances.

Quick update will update all open pages. Update whole project will update all pages in the project. Remember, that in both cases you need to manually save changed files."

If this works could you post back here just in case others hit the same difficulty… also let us know if it doesn’t work :slight_smile:

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.

I am now using partial “includes” for the menus and headers via a javascript. This makes it a little less of a hassle to update docs. However, I’m still experiencing link issues when using MAMP, which seems to interact with PG like an external editor by changing my “/” relative links to “localhost:…” etc.

P.S. I use MAMP to render my JS included pages…because PG doesn’t seem to do this, yet.

HI All
now, A bug report. Well, two.

Bug 1.

I, like Simmo have followed through the Blocks/components usage instructions and have never got them quite right. so here goes.

  1. Attempting to use BenHanna’s blocks as a library.
    He has two Blocks kits on offer, Cards and his Preview selection.

    He has also posted a way to get them too work, however I understand The PG way
    of importing a project as a library and having it stored in a component
    directory to avoid conflicts, as is explained here
    http://docs.pinegrow.com/pinegrow-pro/components/libraries

this is clever and allows for scalability however it doesn’t seem to work correctly.

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 :slight_smile:
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

.

Bug 2.

Also, when adding these resources to the Project A in your instructions on

http://docs.pinegrow.com/pinegrow-pro/components/libraries

I then drag and drop them into the same order as the original project, but, that doesnt seem to stick! they re order themeselves in Project B,

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 :slight_smile:

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! :smiley: 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 :slight_smile:

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! :smiley:

I will try again in a bit, as I have a show this weekend ! :slight_smile:
For http://wellbingessences.com
In Swansea Leisure Centre, South Wales. if you’re about, pop in :slight_smile:

1 Like

Well, I just edited the above as it seemed to have exploded and put all the images in the wrong order. Makes more sense now.

1 Like