List Info

Thread: Xaraya menu




Xaraya menu
user name
2007-09-24 07:25:08
Hi list,

I am trying to implement a new menu on our site using the
base/menu 
block but with templating in XML rather than an html
unordered list. The 
template works fine however it's having a problem parsing it
correctly.

My xml looks roughly like this:

<menu>
     <main text... />
     or
     <main text...>
         <sub text... />
     </main>
</menu>

My problem is trying to tell a parent that it has a child.
The only way 
I have been able to accomplish this is by changing the
parent's menu 
description to something like 'hasChild', etc. While that
works, it 
defeats the purpose of the description

What would be ideal (AFAIK) is if I could step forward to
the next item 
array and see if it's child value exists. That way it would
work. But 
using the PHP next() function isn't working for me. If I set
a variable 
such as nextArray=next($item) and then if
$nextArray['child'] eq 1... ya 
  di, ya, it returns the urls for each item... go figure.

Any other ideas?

Blessings,

Chris
_______________________________________________
Xaraya_devel mailing list
Xaraya_develxaraya.com
http:
//xaraya.com/mailman/listinfo/xaraya_devel

Re: Xaraya menu
country flaguser name
United States
2007-09-27 12:32:53
Chris Wheatley wrote:

> Hi list,
>
> I am trying to implement a new menu on our site using
the base/menu 
> block but with templating in XML rather than an html
unordered list. 
> The template works fine however it's having a problem
parsing it 
> correctly.
>
> My xml looks roughly like this:
>
> <menu>
>     <main text... />
>     or
>     <main text...>
>         <sub text... />
>     </main>
> </menu>
>
> My problem is trying to tell a parent that it has a
child. The only 
> way I have been able to accomplish this is by changing
the parent's 
> menu description to something like 'hasChild', etc.
While that works, 
> it defeats the purpose of the description
>
> What would be ideal (AFAIK) is if I could step forward
to the next 
> item array and see if it's child value exists. That way
it would work. 
> But using the PHP next() function isn't working for me.
If I set a 
> variable such as nextArray=next($item) and then if
$nextArray['child'] 
> eq 1... ya  di, ya, it returns the urls for each
item... go figure.
>
> Any other ideas?
>
> Blessings,
>
> Chris

Hi Chris,

You'll probably have to utilize the next(), prev(), and
current() PHP 
functions in your template in order to move the internal
array pointer 
so you can peek around in the items array.  This would allow
you to 
avoid copying item data into new varaibles.


Dracos
_______________________________________________
Xaraya_devel mailing list
Xaraya_develxaraya.com
http:
//xaraya.com/mailman/listinfo/xaraya_devel

Re: Xaraya menu
user name
2007-10-04 09:46:27
Dracos,

Thanks for the idea, though I had tried it. For some reason
it didn't 
work as I expected and I couldn't figure out why. I haven't
worked on it 
in a few weeks, but if memory serves me, I did something
like if 
next($item) blah, then this_blah.
I expected Xaraya to show me "Array" for my item,
instead it gave me the 
first child value of each parent array. Weird...

Chris
> 
> Hi Chris,
> 
> You'll probably have to utilize the next(), prev(), and
current() PHP 
> functions in your template in order to move the
internal array pointer 
> so you can peek around in the items array.  This would
allow you to 
> avoid copying item data into new varaibles.
> 
> 
> Dracos
_______________________________________________
Xaraya_devel mailing list
Xaraya_develxaraya.com
http:
//xaraya.com/mailman/listinfo/xaraya_devel

Re: Xaraya menu
country flaguser name
United States
2007-10-17 19:25:50
Hi Chirs,

I haven't touched Xaraya for some time, so this response may
be too late for 
you.

But I did something similar so that I could get some drop
down navigation 
menus working on my site. From memory, I traversed the array
by using a key 
value, but I can't remember the details. I've been out of
coding for too 
long.

I documented what I did, but I am not sure if the News Group
allows 
attachments. So if you want details, drop me a line and I'll
send the 
document and corresponding files to you.

Cheers,


Wayne


"Chris Wheatley" <clwheatleyhotmail.com> wrote in message 
news:fe2u5k$6o9$1newton.xaraya.com...
> Dracos,
>
> Thanks for the idea, though I had tried it. For some
reason it didn't work 
> as I expected and I couldn't figure out why. I haven't
worked on it in a 
> few weeks, but if memory serves me, I did something
like if next($item) 
> blah, then this_blah.
> I expected Xaraya to show me "Array" for my
item, instead it gave me the 
> first child value of each parent array. Weird...
>
> Chris
>>
>> Hi Chris,
>>
>> You'll probably have to utilize the next(), prev(),
and current() PHP 
>> functions in your template in order to move the
internal array pointer so 
>> you can peek around in the items array.  This would
allow you to avoid 
>> copying item data into new varaibles.
>>
>>
>> Dracos 


_______________________________________________
Xaraya_devel mailing list
Xaraya_develxaraya.com
http:
//xaraya.com/mailman/listinfo/xaraya_devel

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )