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

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