Question about Components

In Pinegrow 5.1
Question: Can I use Components for a piece of content that is used on various pages, so that when I update the component, it will update the content everywhere it was used? For example: header, footer, pricing table.

Is there a difference between components and smart components?

That’s exactly the reason why they have been created for. I make heavily and successfully use of them, it’s a JustWork™ - just for the protocol.

As far as I remember: NO! It’s just a naming thing, changed somewhere somehow in a version I can’t recall.

Cheers

Thomas

Thank you. Not sure why I have had so much trouble getting the master pages and components figured out.

There’s only one tipp from my side: “Don’t overthink them!” What I recognised is, that people expect “Similar - but not the same kind of thing”. Some to keep the same content, some with slight changes. It is what it is: A reusable component - keep it as is.

Cheers

Thomas

I’ve been using server side includes but would prefer not to so if i can use a component instead that would be ideal. I will persevere and figure how out to use it.

If anyone would be willing to walk me through the components feature used in this way, I’d really appreciate it. I have read the instructions numerous times, but they are a bit confusing since they apply to previous version. I can’t figure out how to create a component and have it show up in the library so i can easily add to another page. I’d like to start with using a component for my top navigation so I can update the top nav in one place and have all pages update to the new version.

  1. Make sure that you work local - and make sure that the pinegrow.json file is present.
  2. Build your element first - e.g. on the index.html. In the shown example, it’s the footer-element we’d turn into a component.
  3. Select the element (footer) and select the actions tab within PG.
  4. Under “Define Components”, put something into the three fields (the better you do, the easier to understand and check the two ticks.
  5. The Component then should be available within the library

Use it on a following page.

Make a change - e.g. the year (on index.html the place you defined the component)


… and update the whole project.

Finally - if you’re happy go file → Save all

Exactly this way, it worked for me!

Good luck

Thomas

1 Like

I followed the steps for defining the component but it is not showing up in my library.

Oh, I see I needed to refresh the components. I see it now.

Thank you so much for your instructions. I really appreciate it!

The other way is to use a php include function, for instance one file with your navigation so when you update this file it updates the navigation throughout your site. When developing this you will need a local server, MAMP or the like to test it or upload it to your host. A tutorial is available here
https://www.w3schools.com/php/php_includes.asp

1 Like