Topic Closed
fly06
263 Posts
17.7K Downloads
1 Themes
8 Plugins

 

I am thinking about porting one of my websites to gpEasy.
 
I believe that everything should go fine except that I don't know yet how I can override some hardcoded gpEasy html (core and plugins).
 
Can someone tell me how to proceed if this feature exists in gpEasy? (I would say it doesn't but I might be wrong)
 
If it happens to be a "coming soon" feature ;-) is there any workaround or third-party solution to address this issue? (I mean something cleaner than simply hacking the core/plugin files)
 
Thanks.
 
Edited: 7 years ago#4562

Josh S.
2K Posts
263K Downloads
16 Themes
18 Plugins

I believe that everything should go fine except that I don't know yet how I can override some hardcoded gpEasy html (core and plugins).

Any specific areas where the hard-coded html is causing problems?

7 years ago#4573

fly06
263 Posts
17.7K Downloads
1 Themes
8 Plugins

Let's take the special_contact.php file as an example.

The hard-coded html for the name field is :

<label for="contact_name">
<span class="title">Your Name</span>
<input id="contact_name" class="input text" type="text" name="name" value=""  />
</label>

My css template uses the following simpler code :

<input id="form_name" type="text" name="name" value="Name" onfocus="if(this.value=='Name'){this.value=''};" onblur="if(this.value==''){this.value='Name'};" />

Of course in this case, I can hide the span (span.title {display: none}) and move the inline javascript (onfocus event) in the head.

But this is a general question/remark because in most cases it can be either tedious or simply not possible at all to trick the hard-coded html to make it look like your specific template html.

Supporting some kind of template overriding would be a real asset for gpEasy.

Edited: 7 years ago#4577

jogai
264 Posts

Here is a nice explanation how to do a cross-browser placeholder: http://www.hagenburger.net/BLOG/HTML5-Input-Placeholder-Fix-With-jQuery.html

And yes, the span has to be hidden. Luckily its not that hard with a span..

 

7 years ago#4579

fly06
263 Posts
17.7K Downloads
1 Themes
8 Plugins

A related question:

Can we add hooks in a theme?

7 years ago#4593

Josh S.
2K Posts
263K Downloads
16 Themes
18 Plugins

Absolutely. Just like in the gpEasy core or plugins:

<?php

gpPlugin::Action('hook_name');

http://gpeasy.com/Plugin_Hooks

http://docs.gpeasy.com/Main/Plugins/Hooks

 

7 years ago#4595

fly06
263 Posts
17.7K Downloads
1 Themes
8 Plugins

Ok we can add custom hooks in plugins and themes (template.php).

But my question was about using core hooks in themes (Addon.ini):

[CoreHook]
script = 'functions.php'
method = 'myTemplateCoreHookFunction'

?

Thanks.

Edited: 7 years ago#4598

Josh S.
2K Posts
263K Downloads
16 Themes
18 Plugins

Sorry, no. Addon.ini hook definitions aren't available in themes. I can definitely see the use in having them

7 years ago#4600

fly06
263 Posts
17.7K Downloads
1 Themes
8 Plugins

 

Josh is right. 
 
Having the hook support in themes is not necessary at least for the purpose of this thread.
 
We can actually rewrite the $page->contentBuffer html directly in the template.php file before the $page->GetContent() call:
 
<?php
global $page;
$page->contentBuffer = myHtmlRewritingFunction($page->contentBuffer);
function  myHtmlRewritingFunction($old_html) {
/* Rewriting stuff goes here */
return $new_html;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
// Your template content goes here
 
It is a workaround to the lack of (plugin or core) template overriding support that:
- Works fine
- Does not need to hack any core or plugin file
- Is included in the template package 
 
Problem solved.
 
Thanks to all.
7 years ago#4665

Topic Closed

 

News

Typesetter 5.1
8/12/2017

Typesetter 5.0.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

Over 8 Times Faster Than Wordpress
5/3/2016

We've known for a long time that Typesetter is fast. It's something we take pride ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register