Re: mixing xhtml-plugin and gallery-plugin
Christian Stocker <[email protected]>
| Newsgroups | gmane.comp.cms.bitflux.general |
|---|---|
| Message-ID | <[email protected]> |
Hi
On 16.6.2005 10:53 Uhr, Matthias Dieke wrote:
>
>
> Matthias Dieke wrote:
>
>>> 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;
> }
I'd the paramter rename "file" to "defaultId" (or simething with
default), and check if the parameter exists, if it doesn't the
str_replace line isn't necessary. Then it's fine for me and you can
commit it
I was thinking something along the same line. I'd prefer a more generic
way for that problem in general, but don't know a solution right now. So
this hack is ok :)
chregu
>
> 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