Support

Home Forums Event Espresso Premium How to add text to custom templates

How to add text to custom templates

Posted: September 19, 2014 at 2:56 am


Joshua

September 19, 2014 at 2:56 am

How can I add extra text to custom template files. I would like to do something like this below.

How it is now:

<?php //Pending Approval Page Template ?>
		<h3><?php echo $fname ?>,</h3>
?>

How I need it to be:

<?php //Pending Approval Page Template ?>
		<h3><?php _e('Dear', 'event_espresso'); ?> <?php echo $fname ?>,</h3>
?>

Additional info:
Wordpress version: 4.0
Event Espresso version: 3.1.36.5.P
New installation
URL: http://develop.letslunch.nl/


Joshua

September 19, 2014 at 3:17 am

Just to be clear changes made to the template pending_approval.php are not showing in front.

Am I editing the wrong template file?


Dean

September 19, 2014 at 3:18 am

Hi,

That looks fine to me, you can copy the /wp-content/plugins/event-espresso/templates/pending_approval.php file over to wp-content/uploads/espresso/templates/ and updates wont over write the changes.


Joshua

September 19, 2014 at 3:51 am

Okay Dean, thanks but I already did that. But changes made to the custom template are not shown on the website after a refresh. I can’t figure this one out.

Furthermore if I add a new translated text string <?php _e('Some text', 'event_espresso'); ?> how will this be added to the .mo or .po file? Is this something I’ll have to do manually?


Dean

September 19, 2014 at 3:59 am

Ahhh sorry I didn’t see it but there’s a typo: you added in a random closing PHP bracket ?>

It should just be

< ?php //Pending Approval Page Template ?>
		

< ?php _e('Dear', 'event_espresso'); ?> < ?php echo $fname ?>,

Regarding the translation, if you need that string to be translated further, then yes it would have to be added to the PO and MO files.

I would suggest modifying the template locally then running the plugin through Poedits “Update from sources” option to generate the new PO and MO files, then upload to the site.


Joshua

September 19, 2014 at 4:10 am

Do you have any further documentation on adding text string via POEDIT?


Dean

September 19, 2014 at 4:49 am

We don’t, but it’s pretty simple.

Make the changes to the code
Open the PO file in poedit
Click Catalog
Click Update from sources
Save

You could also edit the PO file directly but you will still need to open it in Poedit and save so that the MO file gets updated as well.


Joshua

October 1, 2014 at 12:51 pm

Hi Dean, I just checked this. Only changes made directly to /wp-content/plugins/event-espresso/templates/pending_approval.php are being update. But if I change the file in /wp-content/uploads/espresso/templates/pending_approval.php nothing happens. How can I fix this problem?


Dean

October 2, 2014 at 1:06 am

Hi,

Not sure if you can unless you point the PO file at the location of the translation.

E.g.

Please see this pastebin – http://pastebin.com/UKtqMieB

I haven’t tested it but I think that would be the only way to do it, as currently it is looking for text within the main plugin files.


Joshua

October 2, 2014 at 2:23 am

I think it doesn’t have anything to do with the PO file because changes made to the template file itself (I.E. changing the h3 into h1) are not shown.

Despite other template files where I have no problems at all.. strange.

Please advise.


Dean

October 2, 2014 at 4:13 am

Ahh my apologies, I didn’t quite pick up on the change of topic, I thought you were referring to language changes.

This is an issue we are aware of, the pre approval template is not being looked for in the uploads directory. This has been fixed and will be included in EE 3.1.37 (a beta version of 3.1.37 is available in the Pre Release channel in your account page).


Joshua

October 2, 2014 at 4:18 am

Currently i’m running version 3.1.36.5.P and got notified of a new version 3.1.36.6.P.

Can I easily update the plugin?


Dean

October 2, 2014 at 5:56 am

Hi,

You can update the plugin sure, though 3.1.36.6 does not contain the fix. The Beta version of 3.1.37 is available in the Pre Release channel (http://eventespresso.com/wiki/pre-release-channel-guide/) but bear in mind it is a beta so there may be unexpected bugs. We normally only recommend using beta on test/development sites.

The beta version will notify you of updates as well, just like the normal release does.


Joshua

October 2, 2014 at 7:46 am

I’m only asking about the safe release versions. So I can just over right the plugin with the newer version?


Tony

  • Support Staff

October 2, 2014 at 8:02 am

I’m only asking about the safe release versions. So I can just over right the plugin with the newer version?

You can either use the auto updates or manually update by first deleting the current plugin and uploaded the latest version.

See here for more details – http://eventespresso.com/wiki/updating-event-espresso/

However as with any update to Event Espresso (or any plugin), if you have modified core files those modifications will be lost. Translations using .MO/.PO files saved within wp-content/uploads/espresso/ will continue to work on the new version.

If you are unsure I would recommend performing a full site back (including all files and the database) before updating. We recommend doing this before updating any plugins/themes as a precaution.


Joshua

October 3, 2014 at 2:42 am

You can either use the auto updates or manually update by first deleting the current plugin and uploaded the latest version.

Thanks Tony. I’ve just updated to 3.1.36.6.P. Everything is fine as far as I can see.

Is there an ETA on the 3.1.37 release?


Tony

  • Support Staff

October 3, 2014 at 4:06 am

3.1.37 is currently undergoing internal testing, I can’t give you a date of release currently (as it depends on how testing goes) but we are working on releasing it asap.


Joshua

October 3, 2014 at 4:58 am

Ok thanks for letting me know. Hopefully it’s not to long anymore…

The support post ‘How to add text to custom templates’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Joshua 5 years, 1 month ago ago

Topic Tags

Notifications

This topic is:
pending
Do NOT follow this link or you will be banned from the site!
[for="input_96_5_3"]
[for="input_96_5_3"]
[gravityform id=96 title=false description=false]
  • This field is for validation purposes and should be left unchanged.
[i]
[i]
[gravityform id=69 title=false description=false]
  • This field is for validation purposes and should be left unchanged.