Sort photos on gallery application (question SOLVED)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Sort photos on gallery application (question SOLVED)

jsmoraes
This post was updated on .
Is it possible sort the photos on gallery application by the Subject instead of Date ?

I see something at view_gallery_table macro, but I don't know what change at line 50 to do it.

<macro name="gallery_table">
    <table class="gallery">
        <n.page_node.topics_list. sort="pinned-and-root-node-date" start="[n.app_index_record/]" length="[n.app_rows_per_page/]" filter="[n.app_topic_filter/]" >
            <n.handle_empty_gallery/>
            <n.loop.>
                <n.gallery_table_row/>
            </n.loop.>
        </n.page_node.topics_list.>
    </table>
</macro>

It seems to be with sort="pinned-and-root-node-date" or with filter="[n.app_topic_filter/]

No success with the first. If I try change the text  pinned-and-root-node-date with any thing, I have message of:
NAML exception in customized site: 'sort' attribute not set

And with the second I got something,  But shows only one photo with subject="'IC 4651 - Agl. Aberto'", or using subject="'N%'"  I have all photos that subject begins with letter N,  but no sorted by Subject

I caused an error to see the constuction of SQL line and, cleanning the character that cause the error, it shows:

NAML exception in customized site: select * from node where pin is not null and parent_id = ? and is_app is null and (subject like'N%') order by pin

What I think I need is change order by pin to order by subject . Is that ?

Observatório de Astronomia de Vilatur - W. Herschel
Saquarema - RJ - Brasil
http://www.astronomia.pousadavilatur.com.br
Reply | Threaded
Open this post in threaded view
|

Re: Sort photos on gallery application

jsmoraes
I created macros with the same code of the original and did some tests.

Changing app_topic_filter macro I got some thing, but not sorted by Subject. So, to change any thing in it or under it will not solve my problem.

using this:
<macro name="app_topic_filter_jsm" requires="node_page,servlet">
    <n.cache var="app_topic_filter" value="subject='Terzan 7 - Agl. Globular' or subject='IC 4651 - Agl. Aberto' " />
</macro>
or this:
<macro name="app_topic_filter_jsm" requires="node_page,servlet">
    <n.cache var="app_topic_filter" value="subject='IC 4651 - Agl. Aberto' or subject='Terzan 7 - Agl. Globular'" />
</macro>
The result is the same: only two photos with the same position on the page.

In the gallery_tabel.naml macro I only can think in sort="pinned-and-root-node-date"
<override_macro name="gallery_table">
    <table class="gallery">
        <n.page_node.topics_list. sort="pinned-and-root-node-date" start="[n.app_index_record/]" length="[n.app_rows_per_page/]" filter="[n.app_topic_filter_jsm/]" >
            <n.handle_empty_gallery/>
            <n.loop.>
                <n.gallery_table_row/>
            </n.loop.>
        </n.page_node.topics_list.>
    </table>
</override_macro>

Am I in the right way ?
Observatório de Astronomia de Vilatur - W. Herschel
Saquarema - RJ - Brasil
http://www.astronomia.pousadavilatur.com.br
Reply | Threaded
Open this post in threaded view
|

Re: Sort photos on gallery application

jsmoraes
This post was updated on .
In reply to this post by jsmoraes
Well every problem has a solution. When something has no solution... it is not a problem.

I found a wall. A Berlin wall. Or if you prefer a Nabble binary code. With no access.

At the last macro called we have:

<macro name="topics_list" parameters="start,length,filter,sort" dot_parameter="do" requires="node">
    <n.topics_list_standard start="[n.start/]" length="[n.length/]" filter="[n.filter/]" sort="[n.sort/]" do="[n.do/]" />
</macro>

If I override as:

<override_macro name="topics_list" parameters="start,length,filter,sort" dot_parameter="do" requires="node">
    <n.topics_list_standard start="[n.start/]" length="[n.length/]" filter="[n.filter/]" sort="pinned-and-root-node-date" do="[n.do/]" />
</override_macro>

It works normally.

if you change the sort argument to last-node-date, it works, too. But any other sentence... it doesn't work.

As this information go to a binary code ... without a list of arguments permited ... crash on a wall: NAML exception in customized site: 'sort' attribute not set !

So the solution to my problem is more easy than I thought !

First I haven't a problem. I have a desire.

Second, to satisfy what I desire, I need to think and work less as Homo-Sapiens and more as Neandethals: pin the topic-photos and organize them.

NAML is a good way to organize HTML lines. But it is a private code, too.
You can do many things. But... only many things... not all !
Observatório de Astronomia de Vilatur - W. Herschel
Saquarema - RJ - Brasil
http://www.astronomia.pousadavilatur.com.br