Mosets Community

Mosets Community (http://forum.mosets.com/index.php)
-   Discussions, Troubleshooting and Problems (http://forum.mosets.com/forumdisplay.php?f=32)
-   -   Sold Sign Overlay on Images (http://forum.mosets.com/showthread.php?t=19652)

johnlanglois 05-04-2012 05:41 AM

Sold Sign Overlay on Images
 
I think I have asked this before, but never received an answer.
Is there a way to have a "SOLD" sign over properties which are no longer for sale?
I am using an extra field to track availability as either "Available" or "Sold."
For those that are sold, I would like to have the CSS process a text banner and layer it over the image.

Where is the code that processes the building of the page view of properties in a particular category?

Has someone already invented this wheel?

Thanks.

johnlanglois 06-11-2012 04:50 AM

Sold Sign Overlay
 
For the benefit of the next pilgrim to pass this way, I will answer my own question with insights gleaned from support.

Change _summary.php, located in your website path->components->com_hotproperty->views->properties->tmpl

This is pretty much MVC architecture.

Code:

<?php $hotproperty =& MosetsApplication::getInstance('hotproperty');
//Use the following variables to inform the building of HTML part of the page
    $span_status = '';
        $span_markup = '';
        $extrafield_value ='';
       
foreach ($this->extrafields as $extrafield) :
        $extrafield_value = MosetsHTML::_('hotproperty.content.extrafield', $extrafield, $this->property);
               
// leave the spaces in the var definitions
                       
        if($extrafield_value =='SOLD') :
                //echo "extra field value is " .$extrafield_value;
                $span_status = ' sold';
                $span_markup = 'sold';
                $span_close = ' </span>';
                else :
// echo "this was not a sold field";
                        endif;
        endforeach;


echo MosetsHTML::_('content.header', $this->headerLevel,
        MosetsHTML::_('link', JRoute::_(MosetsRoute::getLink('hotproperty', array('view' => 'properties', 'layout' => 'property', 'id' => $this->property->id))),
                ($hotproperty->getCfg('show_thumb') ? '<span class='.$span_status.'>'.$span_status. '</span>'. MosetsHTML::_('hotproperty.image.photo', 'thumbnail', @$this->property->Photo[0]->thumb, null, '')  : $span_markup) . $this->escape($this->property->name)
        ),
        $this->property->name,
        null,
        array('class' => 'contentheading')
); ?>

With this is place all you need is a class in CSS to get the sold sign to overlay the thumbnail.

Code:

.sold{/** text **/
font:bold 1.0em/1.0em Georgia, "Times New Roman", Times, serif;
color: red;
background: white;
text-align:center;
position: absolute;
width:60px;

/**adjust as needed**/
top: 5%;
left: 20%;
border:double;

/**note: CSS3 TRANSFORM: ROTATE DOESN'T WORK IN ALL BROWSERS YET**/
-webkit-transform: rotate(25deg); /**safari, chrome**/
-moz-transform: rotate(25deg); /**firefox**/
transform: rotate(25deg); /**other browsers**/
}

This will work for displays involving search and results.
It will NOT flow through to the modules, such as the latest display.


All times are GMT +8. The time now is 01:15 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.