Put date and time on Photo Gallery posts

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

Put date and time on Photo Gallery posts

weasy
Nabble

First let me say that you guys have an awesome product!  

Ok, I have question.  I have my Nabble application set to Photo Gallery.  Is it possible to show the date and time of a post instead of just the comments and views on the homepage?

Thanks guys!
Reply | Threaded
Open this post in threaded view
|

Re: Put date and time on Photo Gallery posts

GregChapman
You'll need to edit the NAML code that generates the page. I do not regard myself as a NAML expert, but this macro over-ride seems to do what you want:
<override_macro name="cell_details">
    <div class="weak-color" style="font-variant: small-caps;">
        <t>by <t.author.owner.name truncate="20"/></t>
    </div>
 
    <div class="weak-color" style="width:100%;font-size:80%;margin:.3em 0;font-variant: small-caps;">
       <n.page_node.when_created.long_format/>
    </div>
    <div class="weak-color" style="width:100%;font-size:80%;margin:.3em 0;font-variant: small-caps;">
        <n.if.is_in_subapp>
            <then>
              <t>in <t.location.italic.subapp_link_on_hover/></t>
            </then>
        </n.if.is_in_subapp>
    </div>
</override_macro>
Perhaps some NAML expert can tell me how I could have forced a line break rather  than use:
</div>
<div class="weak-color" style="width:100%;font-size:80%;margin:.3em 0;font-variant: small-caps;">
at lines 8-9. Whatever I tried I got an error.
Volunteer Helper - but recommending that users move off the platform!
Once the admin for GregHelp now deleted.
Reply | Threaded
Open this post in threaded view
|

Re: Put date and time on Photo Gallery posts

weasy
Greg

Thanks for the coding but where do I edit the HTML coding for the page?
Reply | Threaded
Open this post in threaded view
|

Re: Put date and time on Photo Gallery posts

GregChapman
Do this:

1. Select and copy the entire macro code I posted earlier.

2. Go to the "See how NAML generates this page" link and click it.

3. On the screen that appears click the cog-wheel button and select "Search Macros" on the menu that appears.

4. On the screen that appears  ensure that "Macro by name" is selected and enter "cell_details" (without the quotes) into the search box and click the "Search" button
(If you look at the first line of the code copied in Step #1, you'll see it is the cell_details macro that is to be edited.)

5. On the results screen click the "cell_details" link.

6. On the cell_details macro screen, click the "Override this macro" button.

7. In the upper edit box select the entire copy of the original macro and paste in the macro copied in step #1.

8. click the "Save Changes" button.

9. At the top left of the Nabble page, click your forum name link to exit the NAML editor screens.

If it all goes horribly wrong you can always return to the edit page and use the "Remove override" button to return things to the default code.
Volunteer Helper - but recommending that users move off the platform!
Once the admin for GregHelp now deleted.
Reply | Threaded
Open this post in threaded view
|

Re: Put date and time on Photo Gallery posts

weasy
Greg.. You're the best, man!  Thank you so much.  Never have I  read instructions that were written so clearly.

Ok, so the code worked but now the comments and views were replaced with the date and time.

How can I add the comment and views for each post alongside the date and time?
Reply | Threaded
Open this post in threaded view
|

Re: Put date and time on Photo Gallery posts

weasy
In reply to this post by GregChapman
Greg

I just noticed that the date and time does not change at all.  Its the same on all posts regardless of when they were posted.  All posts have this date and time attached to them Nov 26, 2012; 8:57am
Reply | Threaded
Open this post in threaded view
|

Re: Put date and time on Photo Gallery posts

GregChapman
Ah! Apologies!

I did warn you I wasn't a NAML expert.

I guess you'll need to wait till one of the Nabble team comes along and offers a correction to my code.

However, as I explained earlier, it is simple to remove my bad code.

As to including both the date of post and comments and views, it should just be a matter of adding the correct date code to what is already there in the default macro.

Go back into the NAML editor and you should be able to see that all I did was delete the following code to remove the comments and views:
         <n.if.not.is_locked_topic>
            <then>
                <n.if.has_replies>
                    <then.comments_link/>
                    <else>
                        0 <t>comments</t>
                    </else>
                </n.if.has_replies>
            </then>
        </n.if.not.is_locked_topic>
        &ndash;
        <n.views show_text="true"/>
        <n.if.is_in_subapp>
            <then>
                - <t>in <t.location.italic.subapp_link_on_hover/></t>
            </then>
        </n.if.is_in_subapp> 
Replacing it with the line that I now see produces a fixed date!

Apologies again!
Volunteer Helper - but recommending that users move off the platform!
Once the admin for GregHelp now deleted.
Reply | Threaded
Open this post in threaded view
|

Re: Put date and time on Photo Gallery posts

weasy
Greg

No worries but maybe you can help me with this error.  I attempted to add your code but cleared it because I couldn't get it to work.  Now the Nabble app won't let me change simple functions such as text color and an error message appears in the coding.

Error
'n.if.not.is_locked_topic' not valid, only [macro, override_macro, subroutine, override_subroutine, translation, override_translation, namespace, static] tags allowed at root
in (custom_tweak:cell_details:1) -


Any ideas?
Reply | Threaded
Open this post in threaded view
|

Re: Put date and time on Photo Gallery posts

GregChapman
Almost certainly, you have pasted in code in the wrong place or managed to delete a character or two.

Either way, you will have created a macro override.

Depending on exactly which error screen you are seeing, use the "Remove override" or "Remove" button to return the code to the default.
Volunteer Helper - but recommending that users move off the platform!
Once the admin for GregHelp now deleted.
Reply | Threaded
Open this post in threaded view
|

Re: Put date and time on Photo Gallery posts

Pedro
In reply to this post by weasy
Please, try this code:
 <override_macro name="cell_details">
    <div class="weak-color" style="font-variant: small-caps;">
        <t>by <t.author.owner.name truncate="20"/></t>
    </div>
 
    <div class="weak-color" style="width:100%;font-size:80%;margin:.3em 0;font-variant: small-caps;">
        <n.if.not.is_locked_topic>
            <then>
                <n.if.has_replies>
                    <then.comments_link/>
                    <else>
                        0 <t>comments</t>
                    </else>
                </n.if.has_replies>
            </then>
        </n.if.not.is_locked_topic>
        &ndash;
        <n.views show_text="true"/>
        <br/>
        <n.when_created.long_format/>
        <n.if.is_in_subapp>
            <then>
                - <t>in <t.location.italic.subapp_link_on_hover/></t>
            </then>
        </n.if.is_in_subapp>
    </div>
</override_macro> 
Greg, you can break line in HTML using the tag:
<br/>
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Put date and time on Photo Gallery posts

Mencey Melgar
Reply | Threaded
Open this post in threaded view
|

Re: Put date and time on Photo Gallery posts

GregChapman
In reply to this post by Pedro
Curses! Got my XHTML tag the wrong way round. I tried <br> and </br>

There's a slight error in the macro. The final line reads:
lt;/override_macro>
It should read:
</override_macro>
BTW. This highlights a bug in the editor.

When going to apply any change in the standard editor that has an error, such as the above, the screen shows a yellow highlight message "Saving - please wait" but the message then sticks and the newbie user will assume the code was saved successfully. So eventually the newbie user will back out and go to view the change to discover ALL the application customisations are lost.

If you attempt to correct the error you are taken to the advanced editor. The messages on this editor fade and do move to show more helpful messages such as "Data NOT saved, please fix errors" or "Data successfully saved, no errors found".

I think this bug may account for some of weasy's confusion and problems.
Volunteer Helper - but recommending that users move off the platform!
Once the admin for GregHelp now deleted.
Reply | Threaded
Open this post in threaded view
|

Re: Put date and time on Photo Gallery posts

Pedro
In reply to this post by Mencey Melgar
Thanks for help him. I hadn't have read that message yet. Both solutions work
My test forum.