Re: mixing xhtml-plugin and gallery-plugin

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

Matthias Dieke wrote:
> 
> 
> Christian Stocker wrote:
> 
>>
>> On 15.6.2005 23:22 Uhr, Matthias Dieke wrote:
>>
>>>
>>> Matthias Dieke wrote:
>>>
>>>
>>>> Hi,
>>>>
>>>> I like to "mix" the gallery-plugin and the xhtml-plugin. For the
>>>> overview-mode (of gallery-plugin) all works fine. I have some problems
>>>> on the image-mode, the xhtml-plugin isn't in the xml-tree (had a look
>>>> to xml-code www....de/foobar.jpg?XML=1)
>>>>
>>>>
>>>> Here is my .configxml
>>>>
>>>>
>>>> <plugins>
>>>>        <extension type="html"/>
>>>>        <extension type="jpg"/>
>>>>        <extension type="jpeg"/>
>>>>        <extension type="gif"/>
>>>>        <extension type="png"/>
>>>>        <parameter name="xslt" type="pipeline" value="referenzen.xsl"/>
>>>>
>>>>        <plugin type="xhtml" admin="true" />
>>>>
>>>>        <plugin type="gallery">
>>>>            <!--<parameter name="virtualDir"
>>>> value="files/_galleries//referenzen/vermietung/"/>-->
>>>>            <parameter name="columnsPerPage" value="3"/>
>>>>            <parameter name="rowsPerPage" value="3"/>
>>>>        </plugin>
>>>>
>>>>        <plugin type="navitree"/>
>>>>    </plugins>
>>>>
>>>>    <plugins inGetChildren="false">
>>>>        <extension type="xml"/>
>>>>        <file preg="#preview#"/>
>>>>
>>>>        <plugin type="gallery_preview">
>>>>
>>>>        </plugin>
>>>>    </plugins>
>>>>
>>>>
>>>> I'm not sure, but I think the xhtml-plugin has some problems with the
>>>> image-extension (like .jpg, .gif). Is it so? How do I have to use both
>>>> plugins in image-mode.
>>
>>
>>
>> Yes. You ask for "foobar.jpg" for example, the xhtml example is then
>> looking for foobar.en.xhtml (in your configuration, it doesn't care
>> about the extension, as long as it matches the ones defined in
>> <extension>), which of course doesn't exist. You can see, that it works
>> this way, if you try to access index.jpg ;)
>>
>> I assume you'd like to include for example index.en.xhtml, when you show
>> foobar.jpg. Or what's your goal?
> 
> 
> Yes thats what I want to do. I like to include a index.de.xhtml and a 
> gallery. The text from the index.de.xhtml should also be shown when 
> viewing a image on gallery-image-mode.
> 
> 
>>
>> I don't know the best solution right now for this, if anyone has ideas,
>> please tell me ;) I see, that we need something for that...
> 
> 
> What do you thinking about a optinal parameter for the xhtml-plugin. 
> Something like this one:
> 
> <plugin type="xhtml" admin="true">
>     <parameter name="file" value="index.de.xhtml" />
>     
> </plugin>
> 
> When I call the "www....de/collection/foobar.jpg" (gallery-plugin) the 
> xhtml looks for foobar.de.xhtml. No file with this name is found, then 
> the optinal parameter catchs and looks for a the file which is given in 
> the paramter.
> 
> This solution looks more than a workaround ;) What do thinking about this?


I made a implementation of this workaround:


in bx_plugins_xhtml::getIdByRequest() I added the following lines:

if (!isset($this->idMapper[$path.$name])) {
   $id = 
str_replace($path,"",bx_resourcemanager::getResourceId($path,$name,$ext));

   //
   // if resourcemanager returns an empty $id we will check
   // for the parameter "file" and caling resourcemanager again
   //
   if ($id == "") {
     $name = $this->getParameter($path, "file").".".$lang;
     $id = 
str_replace($path,"",bx_resourcemanager::getResourceId($path,$name,$ext));
   }

   $this->idMapper[$path.$name] = $id;
}


the .configxml

  <plugin type="xhtml" admin="true">
     <parameter name="file" value="index" />

</plugin>



If you thinking this is a possible soloution I will commit it.


Matthias



> 
> 
> Matthias
> 
> 
>>
>>
>>> with the above .configxml I get also this php-errors:
>>>
>>> BXCMSNG Errors:
>>> Strict[2048] Declaration of bx_plugins_gallery::addResource() should be
>>> compatible with that of bx_plugin::addResource() in
>>> /home/dima/public_html/bxcms/inc/bx/plugins/gallery.php at line 375.
>>> Notice[8] Undefined index: plugin in
>>> /home/dima/public_html/bxcms/inc/bx/collection.php at line 331.
>>
>>
>>
>> The latest commits should have fixed both errors in Trunk and 1_2 Branch
> 
> 
> Thanks
> 
>>
>>
>> chregu
>>
>>
-- 
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.