How do I find source codes for pages?

Author Message

Rob Hard

Saturday 15 December 2007 10:12:17 pm

I am trying to figure out how to add source codes in EZ Publish 4.0 -- looking to add code for Google Analytics and site advertisers. How can I see the HTML coding used for EZ Publish? It isn't an option in the site administration as far as I can see. How should I go about insert these codes? When I paste the Google Analytics text into the body area of the page, the codes appear in my published document or -- if I try viewing it before publishing -- I get an error message that indicates it cannot recognize the <script> code. Thanks.

Greg McAvoy-Jensen

Saturday 15 December 2007 10:46:13 pm

The source code is php found in the kernel and lib directories. But eZ Publish is designed so that developers don't need to touch the php code; indeed, any changes made would be overwritten the next time you do a software update.

You're looking for templates. The are found in the design directory. The one called pagelayout.tpl is the overarching template; it also displays data from other templates using "module_result.content".

Proper form for working with templates is to always leave the originals (again, so software updates are smooth and effective). They stay behind as backups to the templates you create. Start by copying an existing template you need and make an override rule to call it when you want it. Best practice is to package all this as a new design extension, but extensions have their own learning curve, so at first you can just put your templates inside the design directory.

Learn more about the template system here: http://ez.no/doc/ez_publish/technical_manual/3_10/templates.

Also, you should be aware that much functionality you might need already exists in the form of extensions. For example, you can learn about how to install a pre-packaged Google Analytics extension by Brookins Consulting here: http://ez.no/developer/articles/how_to_use_ez_publish_extensions_google_analytics.

Granite Horizon, Certified Developer of eZ Publish Web Solutions
Provider of the SaaS Solution Granite Horizon In The Cloud | http://granitehorizon.com/cloud
http://granitehorizon.com | +1 916 647 6350 | California USA | @granitegreg
Blog: http://granitehorizon.com/blog

Piotrek Karaƛ

Sunday 16 December 2007 12:00:59 am

If I understand correctly, you are trying to place an advertising zone within your templates. As Greg suggested, this is mainly template work.

Since invocation codes are usually javascript, <b>literal</b> template function may be useful in your case:
http://ez.no/doc/ez_publish/technical_manual/3_10/reference/template_functions/miscellaneous/literal

Also, when you want to manage your zones, you may want to designate one attribute in content classes to store different invocation codes (text block would be the best, I believe), and then modify the templates so that they simply display this particular attribute's content within literal function.

Hope this helps.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Rob Hard

Sunday 16 December 2007 9:23:05 am

Thanks guys.

I'm not so much a developer as I am a writer/content person, so if my questions seem a bit simple, my apologies for that. Even after reading the write up on the templates section and literal, I'm not sure exactly where I make those revisions. That is, when I go into site administration I can't figure out how to get into the template source code of a page... The only option I see is to fill out the form fields, and inserting the literal code there didn't work.

I have another related but different question to this as it relates to the site template. That is, I think I should have selected the more powerful template than I did when setting up the site, and I don't know how to go about changing it. I think I need the more interactive media type of site -- which I think is currently used on Piotrek's site (mediaSITE). How do I go about changing to that approach? To see what I'm creating so far, my site www.threedaydestinations.com.

Last, as it relates to the template pages, the only other question I have is related to modifying a folder page -- for an example, see: http://www.threedaydestinations.com/index.php/eng/Travel-Europe/Travel-Barcelona

I recognized how to insert a table, but when I insert text into a two column table, the right side of the column moves/adjusts. My intent is to create a template on this page that allows a right column for advertising on this page and the pages below it there. I will probably have ads on the upper level pages as well, but noticed that the frontpages have a right column where I can drop ads.

Thanks for your advice. I noticed both of you provide consulting services, perhaps this may be a quick project?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 03:23:14
Script start
Timing: Jan 19 2025 03:23:14
Module start 'layout'
Timing: Jan 19 2025 03:23:14
Module start 'content'
Timing: Jan 19 2025 03:23:14
Module end 'content'
Timing: Jan 19 2025 03:23:14
Script end

Main resources:

Total runtime0.0153 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.2734152.6406
Module start 'layout' 0.00560.0030 741.914139.4766
Module start 'content' 0.00850.0048 781.390693.3359
Module end 'content' 0.01340.0019 874.726638.3047
Script end 0.0153  913.0313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002415.4662140.0002
Check MTime0.00117.0547140.0001
Mysql Total
Database connection0.00085.038210.0008
Mysqli_queries0.002919.220830.0010
Looping result0.00000.163410.0000
Template Total0.001610.510.0016
Template load0.00085.181310.0008
Template processing0.00085.248310.0008
Override
Cache load0.00063.667410.0006
General
dbfile0.00031.716280.0000
String conversion0.00000.070040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs