eZ Community » Forums » Extensions » How to link to my custom Module
expandshrink

How to link to my custom Module

How to link to my custom Module

Saturday 31 May 2008 10:05:35 pm - 8 replies

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

Monday 02 June 2008 9: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

Modified on Monday 02 June 2008 9:13:01 pm by Maxime Thomas

Monday 02 June 2008 10: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?

Modified on Monday 02 June 2008 10:13:04 pm by Piotr Karaś

Tuesday 03 June 2008 10: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.

Wednesday 16 July 2008 9: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

Wednesday 16 July 2008 10: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

Modified on Wednesday 16 July 2008 10:25:34 am by Stefan Eickhoff

Wednesday 16 July 2008 1:34:31 pm

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

Wednesday 16 July 2008 6:16:20 pm

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.

Monday 28 September 2009 12:05:43 pm

@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

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from