singapore: the smallest big galery
home » forum » Templates » customising description fields

You are not logged in.

#1 2009-09-25 12:12:26

andyash
Member

customising description fields

I want to customise the background colours and text colour and sizes for the various image description fields so they look different from each other and I can highlight some of them. How do I achieve this? Which file and which codes need to be edited for this?

Offline

 

#2 2009-09-25 16:44:19

DC
Administrator

Re: customising description fields

Do you mean somthing like this where the text at the botom is dif colors. in this case light gray dark gray.

http://sgal-lab.primaveraphoto.com/view … e=Frame_It

DC


To code or not to code that is the question?

Did my response help you out? Consider donating by buying me a slice, Whats this? Read More!
http://www.clickcraft.net/slice.php

Offline

 

#3 2009-09-25 17:00:18

andyash
Member

Re: customising description fields

Kind of. My site is http://www.vallery.in/gallery.php. It has been embedded through external.php in Lightneasy cms. Currently the description below image goes like this.

    <div class="sgDetailsList">
        <dl>
            <?php foreach($sg->image->detailsArray() as $key => $value): ?>
                <dt><?php echo $key; ?>:</dt><dd><?php echo $value; ?></dd>
            <?php endforeach; ?>
        </dl>
    </div>

There is a field named Status (I had customised and renamed fields and deleted some that I did not need) where I fill the status of the paintings whether SOLD, NOT FOR SALE or leave them blank.

I saw another code where I could add fields one by one

    <div class="sgDetailsList"><p align="center">
<?php
$out = $sg->image->detailsArray();
echo $out['Description']." <B>".$out['Status']."</B>";
?>
</p></div>

But this does not give me the field Title in front of its value. I like the way my current values are shown. I only want the Status value - SOLD/NOT FOR SALE etc. - to be in bold red colour.

My guess is I have to use the <dt></dt><dd></dd> structure. I just want the individual codes to be filled in the DTs and the DDs so I can achieve this.

Offline

 

#4 2009-09-25 17:52:18

DC
Administrator

Re: customising description fields

Ya this is code I wrote for special usage :

Why wouldn't that work for you just set your classes to what you need and check if the var contains data, thats all ... that should work fine.

<div class="sgDetailsList">
<?php
$out = $sg->image->detailsArray();

echo  $out['Description']."<BR><BR>";
if ($out['Status']){
echo "<span class=\"status1\">Status: <B>".$out['Status']."</B></span>";
}else{
echo "<span class=\"status2\">Status: <B>NOT FOR SALE</B></span>";
}
?>
</div>

Somthing like that ...


PS on the site you have some of your txt jammed together you should have space between each:

Description:Asleep 1Size:3ft x 3ftCopyright:ValleryViewed:2 times

DC


To code or not to code that is the question?

Did my response help you out? Consider donating by buying me a slice, Whats this? Read More!
http://www.clickcraft.net/slice.php

Offline

 

#5 2009-09-28 07:20:06

andyash
Member

Re: customising description fields

DC wrote:

PS on the site you have some of your txt jammed together you should have space between each:

Description:Asleep 1Size:3ft x 3ftCopyright:ValleryViewed:2 times

DC

This is coming from the default code I have mentioned earlier. How do I add a space there?

DC wrote:

<div class="sgDetailsList">
<?php
$out = $sg->image->detailsArray();

echo  $out['Description']."<BR><BR>";
if ($out['Status']){
echo "<span class=\"status1\">Status: <B>".$out['Status']."</B></span>";
}else{
echo "<span class=\"status2\">Status: <B>NOT FOR SALE</B></span>";
}
?>
</div>

What I see here is an if else statement that will check if the status field has been filled in and if it hasn't then it will give an output of NOT FOR SALE. I don't want the status field to show at all if it hasn't been filled. I just want it to show in red if it has been filled. How do I achieve this?

The only other fields I want to show are DESCRIPTION, SIZE, COPYRIGHT and VIEWED.

Just wanted to mention - I had to edit a whole lot of pages to remove the Camera description etc. and other such fields that I did not need for the gallery. In the next version can you just build it into the gallery admin which allows the user to add/modify/delete the default fields in one place itself?

Offline

 

#6 2009-09-28 15:42:25

DC
Administrator

Re: customising description fields

Then just make a class in your css style sheet in this case status1.

add this to your style sheet

.status1 {
color: #CC0000;
}

And this to replace your code ...

Code:

<div class="sgDetailsList">
<?php
$out = $sg->image->detailsArray();

echo  $out['Description']."<BR><BR>";
if ($out['Status']){
echo "<span class=\"status1\">Status: <B>".$out['Status']."</B></span>";
}
?>
</div>

As far as fields you shouldn't need to edit a lot just the admin template and the template that your using for your visitors.
I know what your saying as i have removed all the other unused fields as well ... but really did not think it was much to do.

I will tell the other devs about your idea for future release.

As for th jammed txt I never saw that on other templates are I don't use or like modern it has little to no support from thr orig dev who created it from what I see.

I have also pulled it from our downloads in the lab.

Try replacing the loop with this.

Code:

<p class="sgTab"><?php echo $sg->galleryTab(); ?></p>

    <div class="sgDetailsList">
        <dl>
            <?php foreach($sg->gallery->detailsArray() as $key => $value): ?>
                <dt> <?php echo $key; ?>:</dt><dd><?php echo $value; ?></dd>
            <?php endforeach; ?>
        </dl>
    </div>

</div>

I should note this is provided that Status is what you have defined in your code if not then that needs to be changed to use one of the provided vars like camera as your not using it so you can cosomize that to what you need it to be, for example just use that camera var in your if statement.

I realy do not know what and how you moded your script so you may need to experiment.

DC


To code or not to code that is the question?

Did my response help you out? Consider donating by buying me a slice, Whats this? Read More!
http://www.clickcraft.net/slice.php

Offline

 

#7 2009-12-10 11:23:05

andyash
Member

Re: customising description fields

Thanks. I had to add all the lines individually but could get them to work.

<div class="sgDetailsList"><dl>
<?php
$out = $sg->image->detailsArray();

echo  "<dt>Description: </dt><dd>" .$out['Description'] ."</dd> ";
if ($out['Status']){
echo "<dt>Status:</dt><span class=\"status1\"><B>".$out['Status']." </B> </span>";
}
echo  "<dt>Copyright: </dt><dd>" .$out['Copyright']."</dd> ";
echo  "<dt>Viewed: </dt><dd>" .$out['Viewed']."</dd>";
?></dl>
</div>

Offline

 

#8 2009-12-10 16:10:14

DC
Administrator

Re: customising description fields

Yup thats the way to do it that way you have full control ...
I just showed you the 1 for an example.

DC


To code or not to code that is the question?

Did my response help you out? Consider donating by buying me a slice, Whats this? Read More!
http://www.clickcraft.net/slice.php

Offline

 

#9 2009-12-28 20:08:54

andyash
Member

Re: customising description fields

thanks.

Offline