Results 1 to 11 of 11

Thread: Widget from other module

  1. #1

    Default Widget from other module

    Do I need to do something special to use a widget from an other module like for example TaxonomyModule?

    Rgds,
    F

  2. #2
    User
    Join Date
    06-10-09.
    Location
    Loxstedt, Germany
    Posts
    54

    Default Re: Widget from other module

    No you don't. Just assure that the other module is available.
    If you want to publish your own module in the TYPOlight extension repository, you have to add a dependency to this exact module using the dependencies edit button.

    That's all.

    Best,
    Helmut
    Blackmail's such an ugly word. I prefer extortion -- the "x" makes it sound cool.
    -- Bender

  3. #3

    Default Re: Widget from other module

    Thx for the reply! But I think I didn't explain correctly. I want to use this widget I my code. DO I need to include the file or do I need to add some code in my configuaration file, as it look like nothing is happening if I use the taxonomy tree widget.


    thx

  4. #4
    User
    Join Date
    06-10-09.
    Location
    Loxstedt, Germany
    Posts
    54

    Default Re: Widget from other module

    Hi freeyland,

    that's what I meant too
    I don't know the taxonomy module but if the taxonomy tree is a widget (defined by the taxonomy module), you should have the taxonomy module installed. To use the widget in your code, just create a new instance of the widget like you create any other widget. Usually you don't need to import anything because taxonomy made the widget available.

    What you shouldn't do is to copy let's say the taxonomy tree widget class from the taxonomy module into your module and use it there.

    Now, to answer your question: You don't need to import the class and you don't need to add some code to your config file.

    Best,
    Helmut
    Blackmail's such an ugly word. I prefer extortion -- the "x" makes it sound cool.
    -- Bender

  5. #5
    User
    Join Date
    06-10-09.
    Location
    Loxstedt, Germany
    Posts
    54

    Default Re: Widget from other module

    Aaah,

    and since the availability of modules is announced be their alphabetical order in the system/modules directory, you might name the directory of your module with something that is after taxonomy in the alphabet.

    Best,
    Helmut
    Blackmail's such an ugly word. I prefer extortion -- the "x" makes it sound cool.
    -- Bender

  6. #6

    Default Re: Widget from other module

    thx.

    This is what i've done:
    Code:
    $GLOBALS['TL_DCA']['tl_requests'] = array
    (
    	// Config
    	..
    	// List
    	..
    	// Palettes
    	'palettes' => array
    	(
    		'__selector__'                => array('addPoReceived', 'addEnclosure'),
    		'default'                     => 'modules,author;project,details,implications;status;{enclosure_legend},addEnclosure;cost;{poreceived_legend},addPoReceived;comment;taxonomyRoot',
    	),
    
    	// Subpalettes
    	'subpalettes' => array
    	(
    		'addPoReceived'                  => 'poreceived',
    		'addEnclosure'                => 'enclosure'
    	),
    
    	// Fields
    	'fields' => array
    	(
    		......
    		'modules' => array
    		(
    			'label'                   => &$GLOBALS['TL_LANG']['tl_requests']['module'],
    			'exclude'                 => true,
    			'search'                  => true,
    			'inputType'               => 'TaxonomyTree',
    			'eval' 		    => array('mandatory' => true, 'fieldType' => 'radio','rootid' => '1')
    		),
    		.....
    	)
    );
    But I can't see my taxonomytree widget. Do you have any idea?

    thx

  7. #7
    User
    Join Date
    06-10-09.
    Location
    Loxstedt, Germany
    Posts
    54

    Default Re: Widget from other module

    Hm,

    seems good to me.
    What's the name of the folder that contains your dca/tl_requests.php (your module folder)?
    Best,
    Helmut
    Blackmail's such an ugly word. I prefer extortion -- the "x" makes it sound cool.
    -- Bender

  8. #8

    Default Re: Widget from other module

    system/modules/requests

    I've posted an other ticket in the forum to ask if it is possible tu use a widget in the front-end. The told me it is not possible.
    So I think this is the reason why the taxonomytree is not getting displayed. Strange that I don't get any error message.

    I thought you could use all form elements and widgets in a frontend module.


    Thx for the help!!!

  9. #9
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Widget from other module

    The backend uses the dca to instantiate backend widgets as it contains a standard editing framework. The front end doesn't use the dca at all, since it's based on templates, for which you manually have to create every template variable and render the template. The front end contains no structure at all, it's all up to you.

  10. #10

    Default Re: Widget from other module

    Hi,

    Again I tried to use the taxonomy widget in a new project.
    This time i want to use the taxonomy tree in the backend, but still it is getting displayed.

    This is the code I added in DCA / fields part:
    'status' => array
    (
    'label' => &$GLOBALS['TL_LANG']['boekingen']['status'],
    'inputType' => 'TaxonomyTree',
    'eval' => array('mandatory' => true, 'fieldType' => 'radio','rootid' => '2')
    ),

    Do I need to do something else.
    My name of moduleis znowflake, so after taxonomy module

    thx for the help

  11. #11

    Default Re: Widget from other module [closed]

    Hi,

    Found the problem myself.

    taxonomyTree and not TaxonomyTree

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •