I'm have setup a views page grid of nodes. The page has an attachment, which displays node titles in glossary mode (1 letter), e.g. a(1) b(2) c(3) f(4). But this page has double arguments, like so: views_page/arg1/arg2. Arg is a country code I use to filter nodes. Arg 2 is the glossary mode letter (a,b,c,d etc.) for node titles.

Now here's the difficulty:
- on views_page/arg1 everything works, the appropriate glossary items are shown (a,b,c,d) only for selected Country (filter).
- but now on views_page/arg1/arg2... two options, but both not working:

Situation 1. either we do not inherit arguments, but we dont get arg1 in the attachment.
Situation 2. or the we inherit, but now the attachment also inherits itself (arg2)

Desired result:

/country/US ==> shows nodes for US, + shows glossary attachment A - F -G- Q
/country/US/A ==> shows nodes for US beginning with A, + still shows glossary attachment A - F -G- Q (no change in the glossary)

Achieved result:

/country/US ==> OK!
/country/US/A ==> FAILED, either doesnt inherit arg1 (s1 above) , or it inherits arg2 as well (s2 above) . In both cases, the glossary is reduced to itself (only A, instead of A-F-G-Q).

I tried using PHP code as the default argument for the attachment country, return $args[1]; but this isnt recognized (not inherited by the attachment). I also tried request_uri() and explode to get arg[2] from the URL directly, but the request_uri() function isnt available in PHP code for arguments...

So is there a way at all?

Anyone know of a PHP snippet to get the original arg[1] from within a view attachment?

Comments

Anonymous’s picture

Status: Active » Closed (fixed)

Just after typing this amazing story, I found out the PHP code does work, but I was using check_plain function around request_uri(), which somehow caused a problem. Now it works.

ano1’s picture

Hi, can you please share the code you used? I am having the same problem.
Thanks
Ano1