Re: plugin as portlet doesn't work

Christian Stocker <[email protected]>
Newsgroups gmane.comp.cms.bitflux.general
Message-ID <[email protected]>

On 7.7.2005 12:32 Uhr, Matthias Dieke wrote:
> Hi,
> 
> I wrote a plugin and I like to use it as portlet.
> 
> I did the following:
> 
> 1. wrote plugin "bx_plugins_banner" (based on the gallery-plugin)
> 
> 2. edited .configxml of the root and put this into it
> 
> <plugins inGetChildren="false">
>     <extension type="xml"/>
>     <file preg="#plugin=#"/>
> 
>     <plugin type="banner">
>     </plugin>
> </plugins>
> 
> 
> 3. and liked to use the plugin as portlet in master.xsl
> 
> <xsl:variable name="bannerParams" select="'1,6,files/banner/,true'" />
> 
> <xsl:variable name="banner" select="document(concat('portlet://',''
> ,'banner(',$bannerParams,').xml'))/bx/plugin[@name ='banner']/gallery"/>
> 
> <xsl:call-template name="gallery_displayBannerGallery">
>     <xsl:with-param name="gallery" select="$banner"/>
> </xsl:call-template>

you mixed something here :)

the <file preg="#plugin=#"/> code is used for so called "subplugins",
which means plugins of a plugin, they are actually handled by the main
plugin and the plugin= stuff is taken apart there (see the blog code
getContentById in particular).

What you do is to call

portlet://banner(1,6,files/banner/,true).xml

while you try to  match on "#plugin=#", which of course doesn't work.
portlet:// is just a stream handler for the particular request, like you
would do from outside, it doesn't prepend or append anything. So, what
you have to do is, either call


portlet://plugin=banner(1,6,files/banner/,true).xml

and take the code from the blog plugin to handle that. or do

<plugins inGetChildren="false">
     <extension type="xml"/>
     <file preg="#banner(#"/>
     <plugin type="banner">
     </plugin>
 </plugins>

You of course have to take apart your params as well there. Check what
you get in getContentById() in $path and $id, and maybe adjust
getIdByRequest() as well.

To debug that beast, just call (or whatever you write after portlet://)

http://example.org/banner(1,6,files/banner/,true).xml?XML=1

which should return you the XML. You have to be logged in to make that
work, otherwise you get just an empty page

HTH

chregu



> 
> 
> 
> 
> When I call www.domain.tld I get some error messages and the pictures of
> the banner-gallery won't be shown.
> 
> BXCMSNG Errors:
> Notice[8] Undefined index: banner(1,6,files/banner/,true)xml in
> /home/dima/public_html/bxcms/inc/bx/collection.php at line 188.
> Warning[2] Invalid argument supplied for foreach() in
> /home/dima/public_html/bxcms/inc/bx/collection.php at line 133.
> 
> 
> 
> It seams that I never go to bx_plugins_banner::getContentById().
> To test this I put echo "test"; exit; to the getContentById()-Method.
> 
> 
> 
> I can't remember how to show the xml-tree of a plugin?
> 
> www.domain.tld/?plugin=banner.xml&XML=1 ???
> 
> but I doesn't work, is this the correct syntax?
> 
> 
> Thanks for your help
> 
> Matthias
> 
> 
> 

-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  [email protected]  |  gnupg-keyid 0x5CE1DECB
-- 
bitflux-cms mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bitflux-cms
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.