Pages (2): 1 2   
Member
Member
Eddie   2017-12-11, 16:07
#1

Hi guys, I am so glad you built this amazing tool! It is what I have been looking for for such a long time!
I just have a quick question as I am struggling with displaying my pages.
Maybe my question has been asked before, I couldn't find the answer on the forum. I use the ZPArdoise theme and on the Album pages it currently only shows the album thumb and the description.
Is it possible to add page excerpts from zenpage along with these album items? What do I need to add to the album.php? Your help would be much appreciated!
Many thanks!

Administrator
Administrator
acrylian   2017-12-11, 17:04
#2

The simplest way is to use
printPageContent('');

http://docs.zenphoto.org/function-printPageContent.html

This would print the full page content.

Since you want an excerpt you would have to use something like
$pagecontent = getPageContent(''); echo shortenContent($pagecontent);
http://docs.zenphoto.org/function-getPageContent.html
http://docs.zenphoto.org/function-shortenContent.html

You can also use the core object model directly:
$pageobject = new ZenpagePage(''); echo shortenContent($pageobject->getContent());

Administrator
Administrator
acrylian   2017-12-11, 17:24
#3

Sorry, the example was shortened for better overview. Please review the link to the function documentation I included above which includes the parameters you need to set. Basically you need to set the lenght you want to truncate to and the indicator e.g. "(…)".

Member
Member
Eddie   2017-12-11, 17:27
#4

Thank you, its getting a bit complicated for my amateur coding skills.. ;-) I leave it.

Administrator
Administrator
acrylian   2017-12-11, 17:28
#5

It's really not complicated:
echo shortenContent($pageobject->getContent(), 100, ' (…));
100 is the lenght and the last one the shorten indicator. This is really basic PHP stuff you will need always when you like to modify a theme. There is even more sophisticated stuff possible ;-)

Member
Member
Eddie   2017-12-11, 17:36
#6

Thanks!!

Member
Member
Eddie   2017-12-11, 19:38
#7

Ha ha, I guess I need a crash course of php.. Can I challenge you more?
What if I want to display for a specific album only?

Administrator
Administrator
acrylian   2017-12-11, 19:59
#8

You need to know the album name. That's the name in the url like yourzenphotosite.com/toplevel/sublevel1/sublevel2/….

Then use
if($_zp_current_album->name == '') { //do what you want to do }

This works within the next_album loop on index.php or if the theme has gallery.php, on album.php and search.php. On thte latter it works also on the page itself for thte current album. It also works on image.php for the album of the current image.

If you want to do this within a php fucntion you need to declare $_zp_current_album global first.

Member
Member
Eddie   2017-12-11, 20:10
#9

Thanks!!!!

Member
Member
Eddie   2017-12-11, 20:30
#10

Thanks!!!! I do need a course ;-)

Member
Member
Eddie   2017-12-11, 20:44
#11

Something like this?

Member
Member
Eddie   2017-12-11, 20:59
#12

Thanks, I appreciate it. It's out of my league.. But .. it would be a nice add on in Zenpage if you could select what gallery or album you wish to display a page, and then it shows up as a standard thumb or excerpt so you have everything in one overview, albums and pages. Maybe this is just my need though..

Administrator
Administrator
acrylian   2017-12-11, 22:31
#13

This is really a specific need. But your example above was actually correct if the album name is "albumpath" and the page name (=titlelink) is "test".

Maybe you could explain what you actually trying to do or what problem solve? This above only makes sense if the page is somehow related to the album.

Member
Member
vincent3569   2017-12-12, 11:16
#14

the good question is "what is you need?", because it is not clear for me.

in back end, you can add a description on each album, with links to other albums, news or page (you have to use tinyMCE plugin and use "ZP" menu link).

and in news/pages, with the "ZP" menu, you can add album thumb (or a thumb of this album), add the desciption of this album.

Member
Member
vincent3569   2017-12-12, 11:24
#15

and, if you really need to add page content in an album description, I think the best way is to add `somewhere inalbum.php(for example, like that (see line 5 of the file):

`

then you can manage you need by adding html/php code, in the album's Codeblocks.

with that, you can add something like that, without testing album name:
``

Administrator
Administrator
acrylian   2017-12-12, 14:55
#16

That's a way of course, too! Funny thing is I bascially never use codeblocks myself but rather multiple layouts ;-)

Member
Member
vincent3569   2017-12-12, 16:49
#17

Codeblocks are very usefull!
With them, I can have these pages:
http://www.vincentbourganel.fr/pages/portfolio/
http://www.vincentbourganel.fr/pages/map

on the two examples, I use dynamic album in a page and I add html/php code in Codeblocks.

Administrator
Administrator
acrylian   2017-12-12, 17:29
#18

Of course they are and if I am not mistaken it was me who added that feature ;-)

Just I personally don't really use them nowadays. Both your examples I would probably have done via layouts ;-)

Member
Member
vincent3569   2017-12-12, 17:43
#19

I use layouts here:
http://www.vincentbourganel.fr/fetes-des-lumieres-de-lyon/
this album layout use isotope, and others use standard album page.

but I am curious: how did you my two pages above with layouts?

Administrator
Administrator
acrylian   2017-12-12, 17:46
#20

I would just create pages with the code you put into the codeblocks. If it's only a few pages you need specific stuff. I find this easier to maintain than codeblocks on the backend. Might be because I often create custom themes for people who really don't know and want to know code. But they can select layouts ;-)
But if there are more and different things needed I personally might also use codeblocks.

The flexibility of Zenphoto in this regard allows anyone to use it what it fits his needs best.

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.