Forums / Extensions / How to link to my custom Module

How to link to my custom Module

Author Message

John Moritz

Saturday 31 May 2008 1:05:35 pm

I made my first steps on ezpublish and know the most things to customize ezP to fit my needs. I made some custom Modules. When i type the URL of the modules manualy, everything is ok, i can see its working fine. What i dont understand is, how i can Link to my custom Modules automaticly.

What i mean is, i want to choose my Module in the Administrator Interface like Article, Blog, Blog Post, Forum, Forum reply etc. So after that, the Link will be in my Main Menue and then i can do that for different languages. I have not understood how i can do this, how can i bring my Module to the List Menue in administrator interface?

Greetings

Maxime Thomas

Monday 02 June 2008 12:12:41 pm

Hi,

I think it will be a great idea to read some documentation.

Hop :

http://ez.no/doc/ez_publish/technical_manual/4_0/concepts_and_basics

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Piotrek Karaś

Monday 02 June 2008 1:11:55 pm

<i>What i dont understand is, how i can Link to my custom Modules automaticly.</i>
I don't quite understand what you want to achieve with the menus, but generally custom modules, just as system modules other than content/view, are linked manually so to speak (you have to explicitly link to them). It is not possible, as far as I know, put modules in the content tree, but you can create your own class that would be a redirection class (this has just been discussed in the last week or two in the forum).

By the way - wouldn't it be something to be able to place modules in the tree? So that modules do not just stand a random list, but get addresses? Of course, I expect a number of problems with this idea...

Another by the way - have you guys ever tried to mask system module/view names with some other names, for example for translation purposes? Mod rewrite or some other techniques?

--
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

Gaetano Giunta

Tuesday 03 June 2008 1:33:08 pm

<i>By the way - wouldn't it be something to be able to place modules in the tree? So that modules do not just stand a random list, but get addresses? Of course, I expect a number of problems with this idea...</i>

Registered modules get an url by way of the registration process anyway, so you would still have the /module/function url that is accessible by the end user.
Instead of publishing them as content objects, you can set up virtual urls to have them "appear" where you want to. A little bit more counterintuitive maybe, but it should be enough for most needs.

<i>Another by the way - have you guys ever tried to mask system module/view names with some other names, for example for translation purposes? Mod rewrite or some other techniques?</i>
Mod_rewrite works very well, of course. A bit hard to learn, but you can do all kind of magic tricks with it.

Principal Consultant International Business
Member of the Community Project Board

Jianjun Hu

Wednesday 16 July 2008 12:31:58 am

I made a custom module. It works well with the following URLs.

http://localhost/ez/index.php/eng/match/score?file=file_a
http://localhost/ez/index.php/eng/match/score?file=file_b

I want to make two links correspond with two URLs above in homepage. It seems a stupid qustion. But I really don't know how to do. Could someone else please tell me?

Thanks in advance.

onlyblue

☆..·°∴°.☆°°.☆°.
°∴ °☆ .·enjoy star° .·★°∴°
∴°.°★ .·°
  ミ☆°∴°.★☆° ∴·°
°.☆° .·∴° 

Is it a pleasure after all to practice in due time what one has learnt?

Stefan Eickhoff

Wednesday 16 July 2008 1:21:46 am

Hi,

maybe you could do it this way:

1. install the redirect operator
http://ez.no/developer/contribs/template_plugins/redirect_operators

2. create a custom content class 'http_redirect'
Name, URL, text (for relative URLs)

3. create an override rule

[http_redirect]
Source=node/view/full.tpl
MatchFile=full/http_redirect.tpl
Subdir=templates
Match[class_identifier]=http_redirect

4. create the template http_redirect.tpl

[...]
{set $HttpLocation = $node.data_map.its_relative.content}
{redirectrelative($HttpLocation)}
[...]

5. create an object of the http-redirect-class in your node tree

put the relative path of your module in 'its_relative' text field
e.g. '/MY_MODULE/MY_VIEW/

6. if you want to mark the current selection in the menu you have your module to
set some values in the Result-Array

$Result['node_id'] and $Result['path']

that is just a brief description, I hope you get the idea.
If anyone knows an easier or more straightforward solution please post.
I'll have a look if I could achieve the same with defining a virtual URL, sounds much easier.

have a nice day

Stefan

Andreas Adelsberger

Wednesday 16 July 2008 4:34:31 am

If you need your module in a node of your nodetree you should create a custom operator or a custom fetch to get the output of your custom module, but maybe a way to access a custom module directly from the template would be a nice feature eg.

fetch('module','module_name','view')

---------------------------------------
Styleflasher New Media OG
Websites. Games/Multimedia.

Miguel Quintana

Wednesday 16 July 2008 9:16:20 am

There is an early post from Piotrek Karaś, on this thread
"but you can create your own class that would be a redirection class (this has just been discussed in the last week or two in the forum"

I would like to look into that... but...
I can not find this information on the forum...

Att.
Miguel Q.

meinhard benn

Monday 28 September 2009 3:05:43 am

@StefanEickhoff

Regarding your point 6 (marking the current selection in the menu): It took me a while to figure out how to do it. Adding a node_id to the $Result['path'] entry you need marked does the trick. See path examples on http://ezpedia.org/en/ez/module

http://goozee.benn.org/ - Google Co-op for eZ sites

eZ debug

Timing: Jan 18 2025 03:07:01
Script start
Timing: Jan 18 2025 03:07:01
Module start 'content'
Timing: Jan 18 2025 03:07:01
Module end 'content'
Timing: Jan 18 2025 03:07:01
Script end

Main resources:

Total runtime0.6836 sec
Peak memory usage4,096.0000 KB
Database Queries226

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 588.8281180.8359
Module start 'content' 0.00840.5443 769.6641915.8828
Module end 'content' 0.55270.1308 1,685.5469349.3125
Script end 0.6835  2,034.8594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.6229210.0002
Check MTime0.00150.2226210.0001
Mysql Total
Database connection0.00200.289310.0020
Mysqli_queries0.567883.06212260.0025
Looping result0.00250.35852240.0000
Template Total0.640893.720.3204
Template load0.00240.352420.0012
Template processing0.638393.382920.3192
Template load and register function0.00020.034710.0002
states
state_id_array0.00100.143110.0010
state_identifier_array0.00150.219620.0008
Override
Cache load0.00220.3284810.0000
Sytem overhead
Fetch class attribute can translate value0.00180.2677100.0002
Fetch class attribute name0.00150.2157160.0001
XML
Image XML parsing0.00620.9085100.0006
class_abstraction
Instantiating content class attribute0.00000.0056160.0000
General
dbfile0.00450.6577620.0001
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
21content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
14content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 54
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs