HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


embedding gallery into catalogues

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#32324 (In Topic #7342)
Avatar

Community saint

I think if I remember correctly I am able to embed a gallery into the catalogues how ever at this time I am not sure how to do it.
I kind of what a catalogues entry to look like a download, you know each with its own gallery.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#32396
Avatar

You could add an optional Comcode-supporting field to your catalogue. You would then put the following value in the field for when are adding an entry:

Code

[block="my_gallery_name_123"]main_gallery_embed[/block]

Please note that my_gallery_name_123 would have to be different for each catalogue entry that had a different embedded gallery, and that the gallery with this name would need to exist. You would need to add images to this gallery, although for an empty gallery, you would get a "no entries" message with an add link – which would remain until you added at least one image to it.

If you want it to look a bit tidier (so that the gallery isn't shown as a normal field) you could edit the CATALOGUE_DEFAULT_ENTRY_FIELD template to:

Code

{+START,IF,{$EQ,{FIELD},Images}}
{+START,SHIFT_ENCODE,cimg}
{VALUE}
{+END}
{+END}
{+START,IF,{$NEQ,{FIELD},Images}}
<tr>
   <th>{FIELD*}</th>
   <td>{VALUE}</td>
</tr>
<tr>
   <td colspan="2" class="tiny_linebreak"></td>
</tr>
{+END}
and the CATALOGUE_DEFAULT_ENTRY template to:

Code

<table summary="{!MAP_TABLE}" class="map_table medborder wide_table">
   {FIELDS}
</table>

{$SHIFT_DECODE,cimg}
and the CATALOGUE_DEFAULT_ENTRY_EMBED template to:

Code

<table summary="{!MAP_TABLE}" class="map_table medborder wide_table">
   {FIELDS}
</table>
{$SHIFT_DECODE,cimg}

<p style="float: left">
   <a href="#"><img class="blend inline_image" title="{!BACK_TO_TOP}" alt="{!BACK_TO_TOP}" src="{$IMG*,top}" /></a>
</p>
<p style="float: right">
   <a href="{VIEW_URL*}" title="{FIELD_0*}"><img class="blend" title="{!COMMENTS} / {!VIEW}" alt="{!COMMENTS} / {!VIEW}" src="{$IMG*,pageitem/goto}" /></a>
</p>

<br class="float_passer" />

<br />

Note that these changes assume your gallery field is entitled 'Images'.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#32397
Avatar

I haven't checked the above, but the principles are sound. One thing though is that I'm not sure if the code will work on the category view – it might only work when entries are shown on their own pages.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#32406
Avatar

Community saint

Thanks I will give it a try to see what happens.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#33391
Avatar

Community saint

something seems to be wrong with this or I found a bug.
I used this code.

Code

[block="hacksign"]main_gallery_embed[/block]
Its saying

Code

There are no entries at this time
yet when I click add and not change any thing and just upload image it shows up in the gallery called hacksign. There are now 2 images in there and just for a little bit more info here is the url after the domain.

Code

/site/index.php?page=galleries&type=misc&root=root&id=hacksign
Thats the gallery.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#33401
Avatar



Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#33502
Avatar

Community saint

now that its working is there a way to add links for adding more and a link to see the whole Gallery.
Also I only want it to show 3 from that gallery and then the links above.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#33507
Avatar

Community saint

Also why is this code not working.

Code

<center> <div style="width: 30%; float: left">{IMAGES}</div></center>
I am using that in BLOCK_MAIN_GALLERY_EMBED.tpl.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#33536
Avatar

I only want it to show 3 from that gallery

This isn't really supported, but it could be done with some template editing.
I think changing the GALLERY_IMAGE template to this would work:

Code

{$INC,gcntr}
{+START,IF,{$AND,{$LT,{$GET,gcntr},4},{$EQ,{_GUID},043ac7d15ce02715ac02309f6e8340ff}}}
{+END}
{+START,IF,{$NEQ,{_GUID},043ac7d15ce02715ac02309f6e8340ff}}
<div>
   <a href="{VIEW_URL*}">{THUMB}</a>
</div>
{+END}

now that its working is there a way to add links for adding more and a link to see the whole Gallery.

I'll explain this in my next post.

Also why is this code not working.

It's working as I'd expect it to. Center is centering the div (so the 30% of the space is allocated from within the middle of that space), and it is centering the contents within the div – except that the "float: left" undoes that contents centering, because it's pushing it back to the left.
If you remove "float: left", it is a normal center.

I'm not sure exactly what you're looking for, but if you want 30% space to be used up, and for centering to occur within that space, this will do it:

Code

[html]<div style="width: 30%; text-align: center; float: left">{IMAGES}</div>[/html]


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#33537
Avatar

now that its working is there a way to add links for adding more and a link to see the whole Gallery.

The main problem here is that the template doesn't know the gallery name. To change that, change line 109 of sources/blocks/main_gallery_embed.php from:

Code

      $tpl=do_template('BLOCK_MAIN_GALLERY_EMBED',array('_GUID'=>'b7b969c8fe8c398dd6e3af7ee06717ea','IMAGES'=>$entries));
to:

Code

      $tpl=do_template('BLOCK_MAIN_GALLERY_EMBED',array('_GUID'=>'b7b969c8fe8c398dd6e3af7ee06717ea','CAT'=>$cat,'IMAGES'=>$entries));
(this will be included in the next patch release).

Then you just need to put this kind of thing into that template…

Code

<p><a href="{$PAGE_LINK*,_SEARCH:galleries:misc:{CAT}}">view gallery</a> | <a href="{$PAGE_LINK*,_SEARCH:cms_galleries:ad:cat={CAT}}">add image</a></p>


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#33546
Avatar

Community saint

will that first reply effect normal galleries?

Oh and thanks.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#33548
Avatar

No, that _GUID stuff in there targets it just to the block. I've seen an automated error mail from your site… I think you need to add this line also at the start of the template:

Code

{$INIT,gcntr,0}


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#33552
Avatar

Community saint

ok well I got a stack error when I tried to use it.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#33599
Avatar

Community saint

Ok I will try it a little latter I am just busy today.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#33734
Avatar

Community saint

I have not tested this yet but the last time I did it showed a long row of images instead of 3 beside each other.
So I decided to go with the random image block as that works perfectly.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: