Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
adding gallery to page
#1
Hello:
First off on a scale of 1 to 10 in knowing PHP I am a "Newb."
The reason I am trying to use GS is I want to make a site but I also want to learn how to manage my content.

So far I have done a great job in setting up my site in what I want on it. The look and feel of the site is not polished in means of content and layout but structure wise I have the components I want on my page.

What I am having a problem with is having the gallery appear within the page.

It will help if I explain the structure of the site.

I want all "content blocks" (Video, article, headline, link-block and gallery) to originate from the page.
I have currently accomplished this with everything except the gallery.

Using "I18N Custom Fields" I have created the following custom fields.
1: Video "WYSIWYG"
2: article "WYSIWYG"
3: linkblock "WYSIWYG"
4: pics "WYSIWYG"

My code is:
Code:
<div class="mainHeadline"><center><HR /><h1><?php get_page_title(); ?></h1></center><HR /></div>
<Div class="storyContent"><center><?php get_custom_field("video"); ?></center>
<div><?php gallery("tester"); ?></div></div>
<div class="storyBody"><?php get_custom_field("article"); ?>
<div class="linkblock"><?php get_custom_field("linkblock"); ?></div></div>
<?php get_custom_field("pics"); ?>???
<?php include('gallery.php'); ?>

The Gallery is called "tester" and when I use the direct PHP call to the gallery (third line in the code) the gallery shows up.

What I would like to do is define the gallery in the actual custom field in the page and have the template look for this and display what ever gallery name I define in the page.

I tried putting the php into the "pics" field on the page but it ignores it.
The last two lines of code are just me trying to figure it out and the "gallery.php" is just a page with the third line of code in it.

Basically I am trying to build a page with several different elements in it and I think I have done most of it but this last part is stumping me.

Here is the link to the page, ignore the content in the page as it is just placeholder information for the purpose of filling up the content boxes. Also ignore the layout as I have not refined the boxes at all either.

http://www.banooner.com/pmfm3/index.php?...new-fields
Reply
#2
liverdude Wrote:Hello:
What I would like to do is define the gallery in the actual custom field in the page and have the template look for this and display what ever gallery name I define in the page.

If I understand you correctly, you should use a custom (text) field galleryname and then add the following code to your template:
Code:
<div><?php gallery(return_custom_field('galleryname')); ?></div>
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#3
I'm trying to just display a single gallery by writing it's name into the field.

I added your code and it pulls out all my galleries and not a single defined gallery.

Say I have two galleries "Tester" and "working" and I only wanted to display "working"

I put the value (or text) "working" into the field on the page (page.jpg) and now I want to pass that value to the page as the gallery to use.

I am sorry if you did give me the correct answer and I didn't clue into it, my programming skills are growing each day but currently I am very green to it all.
Reply
#4
Ok I got it to work and pull in the gallery I want from a separate defined box within the page itself.

I achieved it by doing this.
1: Create a custom area within the page using the "I18N Custom Fields" plugin. I called the field "pics"
2: Set a variable "$gallery" with the value of the "pics" field.
3: Called for and display the "$gallery" Value.

The code was pretty simple after I figured out how to set variables and here are the two lines that do it.

Code:
<div><?php $gallery=return_custom_field("pics"); ?>
<div><?php squareit_gallery($gallery);?></div>

It works fine I just wish the gallery plugin was smart enough to find subfolders within my files area cause right now it only sees pictures within the root of my files and ignores any subfolders.
Reply




Users browsing this thread: 1 Guest(s)