Post by Qphoria » Wed Dec 01, 2010 1:29 am

This was something I saw in Website Baker and wanted to add to opencart. When creating pages in WSB you can choose the "type" of page it is (wysiwyg, code, faq, etc). They actually have this extensible so that you can create new types as modules and choose from custom module templates. So wysiwyg loads the wysiwyg editor, form loads the form designer, faq loads a Q&A designer, etc.

While that would be ideal to have a system like that in OC, for now I wanted to add a simple modification to allow "code" type to be used for information pages. This means that you can actually have different content show based on what conditions you setup. Dynamic Information pages!

So I did it.

Check my DEMO.
It simply shows whether you are logged in or not.
You can login with demo@demo.com/demo and see the message change again when you log back out.
This is just a simple example but much more can be achieved and the code change is quite simple.

This is how it looks in the admin:
http://www.screencast.com/users/DssTrai ... 5f621ae683

I'm going to play with it more and perhaps release it as a mod but I'd like to put it into the core as well at some point. Perhaps with an updated php syntax editor like this:
http://codepress.sourceforge.net/index.php
or
http://www.lostintechnology.com/interne ... -on-the-go

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Johnathan » Wed Dec 01, 2010 5:27 am

Nice work! It's an interesting idea, and something that would be neat to have in the core at some point in the future.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by i2Paq » Wed Dec 01, 2010 5:35 am

Yes, that is what I like about WB to!

Plus you can mix pages of a different kind and even change the order in which they appear.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Xsecrets » Wed Dec 01, 2010 7:35 am

looks interesting unfortunately that first linked highlighter does not work in chrome.

I like the idea of being able to put code into the pages from a usability perspective, but the little security minded voice in the back of my head kind of screams eval() NOOOOO! :crazy:

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Wed Dec 01, 2010 10:27 am

Xsecrets wrote:but the little security minded voice in the back of my head kind of screams eval() NOOOOO! :crazy:
They have meds for that :)

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by HTMLCSSNoob » Wed Dec 01, 2010 11:42 am

Qphoria wrote:form loads the form designer, faq loads a Q&A designer, etc.
I'm all for the form and FAQ designer. It would be great if we could use the form designer on the contact us page so we could create our own custom contact us form easily.

The FAQ form designer would be great too of course.

Look forward to it!

Active Member

Posts

Joined
Fri Aug 20, 2010 7:53 am

Post by HomeroOttoni » Fri May 24, 2019 2:42 am

Qphoria wrote:
Wed Dec 01, 2010 1:29 am
This was something I saw in Website Baker and wanted to add to opencart. When creating pages in WSB you can choose the "type" of page it is (wysiwyg, code, faq, etc). They actually have this extensible so that you can create new types as modules and choose from custom module templates. So wysiwyg loads the wysiwyg editor, form loads the form designer, faq loads a Q&A designer, etc.

While that would be ideal to have a system like that in OC, for now I wanted to add a simple modification to allow "code" type to be used for information pages. This means that you can actually have different content show based on what conditions you setup. Dynamic Information pages!

So I did it.

...
Hi.

I would like to insert php code into my info pages, in Opencart 3.01, is it possible?
Can you help me with this question?

Thank you.

Newbie

Posts

Joined
Wed Apr 03, 2019 12:13 am

Post by IP_CAM » Fri May 24, 2019 11:08 am

You could try this free Mod:
OpenCart Template Switcher
https://www.opencart.com/index.php?rout ... n_id=31589
---
or then, you could try this:
https://php2twig.com/
---
Ernie
Image

I'm rarely active at the OC Forum lately. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'200+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by HomeroOttoni » Sat May 25, 2019 2:10 am

Sorry, I did not understand your suggestion (but thank you anyway).
The information pages of Opencart 3.0 are not files, but their code is registered in a table called "information_descriptions".

When I enter a code directly into the registry, for example:

<? php echo "Hello wolrd!"?>

The system replaces:

<! - <? php echo "Hello wolrd!"?> ->

And the page does not "spin" the code. I need a way to insert code into these pages in order to avoid this. Be PhP, be javascript.

According to Qphoria he managed and placed a new item in the information pages that allows you to choose the format.

http://www.screencast.com/users/DssTrai ... 5f621ae683

Thank you

Newbie

Posts

Joined
Wed Apr 03, 2019 12:13 am
Who is online

Users browsing this forum: No registered users and 5 guests