Page 1 of 5

Contact_us

Posted: Wed Jun 08, 2022 6:54 am
by heatherbell
We've recently been working on adding module content to contact_us and started to modularise the page in a template to suit our purpose so we currently have something like this WIP:
Screenshot-2022-06-08-075014.png
However, before we go further down that rabbit hole, we wondered if modularisation of that page would be on the horizon in future core or PRO versions?
Perhaps there a better/easier/preferable way of adding content without doing that? (besides adding it all into a language constant)

Re: Contact_us

Posted: Wed Jun 08, 2022 8:47 am
by ecartz
I'm not opposed to modularizing the page in core. I would not want it to be modular in Pro but not core. It's possible that Pro might have modules that core does not. Core would need to have Title and Form modules to match what is currently there. Hours and Map could potentially be Pro modules.

I don't particularly want to modularize the page in the 1.0.8.* series, as I'm generally finished with the catalog side. But it's not impossible.

In general, modularization seems more Burt's thing than mine. PI layout? Your example has two half-width containers. The PI layout might be a Pro module.

The only way to customize the content now is by hook or template, but it would probably be difficult to create your example layout via the form injection hook. A modular template as an override would be possible.

Re: Contact_us

Posted: Wed Jun 08, 2022 9:26 am
by heatherbell
ecartz wrote: Wed Jun 08, 2022 8:47 amI would not want it to be modular in Pro but not core.
Not sure I understand that wording but I think I know what you mean.
Yes, everything you posted is pretty much what I had thought.
Our example is WIP and 'half way' there with PI being the next stage further down the rabbit hole for us.
I guess that an easy way of adding modular content would be welcomed and good to know that it could be on the horizon - thank you.

Re: Contact_us

Posted: Wed Jun 08, 2022 4:09 pm
by Omar_one
@burt has module maps shows on the contact_us page (28d 2019, OSM Maps) by adding modular content, and I think it will be easy to add more modules ,, but its need to have modularization layout to be like PI layout

Re: Contact_us

Posted: Wed Jun 08, 2022 4:34 pm
by burt
I *think* it would be as straightforward as copying the contact_us.php page from "default" into "override" (if using override template, otherwise whatever template)...then stripping out most of the code, ending up with something like "product_info.php" in terms of code (ie quite "light" in actual code). Then make a "modular" content module for contact_us, along with at least one PI module for contact_us.

That PI module would be the normal "form" / success message, and then any other moduels would be coded up as and when needed (eg by addon makers, normal users, core code additions or whatever), either as contact_us content modules or as child modules for the new contact_us PI. I can look into doing something if it would be of value in the core code?

Re: Contact_us

Posted: Wed Jun 08, 2022 4:41 pm
by heatherbell
burt wrote: Wed Jun 08, 2022 4:34 pmI *think* ...
That's pretty much what I've done in the example.
I used OpenStreetMap for the map.

Re: Contact_us

Posted: Wed Jun 08, 2022 5:15 pm
by ecartz
burt wrote: Wed Jun 08, 2022 4:34 pm That PI module would be the normal "form" / success message,
And also, I was thinking that for consistency, there should be a cu_title.php module.

Re: Contact_us

Posted: Wed Jun 08, 2022 6:37 pm
by burt
I think this is the start of it, or somewhere near the start anyway, consists of;

1. new admin page for CU pi modules
2. new admin link for horizontal menu

Upload /admin/ folder contents to whatever your admin is called. As usual.

3. template page for contact_us (massively stripped down)

Upload this into whatever template you are using (in the zip I placed it in override)

4. new Normal content_module for Title
5. new π Modular contact_us content_module
6. new PI module for CU (just a simple Text module for testing)

Install these as per usual;
#4 via admin > modules > content
#5 via admin > modules > content
#6 via admin > layout modules > contact us

Let me know if anything errors out as I may have missed stuff from the .zip


Of course, as always, you would NOT want to do any of the above testing etc on a live site as it would mean that your shoppers would not be able to contact you, as there is no "form" CU PI module in the .zip - as it is not coded.

Re: Contact_us

Posted: Thu Jun 09, 2022 5:05 am
by heatherbell
burt wrote: Wed Jun 08, 2022 6:37 pmtesting etc
Works as expected
Screenshot-2022-06-09-060329.png

Re: Contact_us

Posted: Thu Jun 09, 2022 1:17 pm
by burt
Untested, but logically...should work...

Zip is only a CU PI module for a contact form. It basically takes the same form from the original contact_us page and recreates it as a PI Module.

Anyone testing would need to have installed (and turned on etc) the previous .zip