Login or create new account.

By registering on joomprod.com, you will have immediate access to all our free products and to the public side of our support forum.

Enjoy our subscriptions.

Each of our subscriptions allow you to enjoy the private side of the support forum and all the update of our products for a period ranging from 3 months to 1 year.

Payment And immediate download.

After subscribing to one of our subscription, the products are immediately downloadable.

Login

Or Register
Accueil / forum / Public Forum / Main Forum / [RESOLVED]Editing default_list.php page for mobile

Support Availability Because we must sleep sometimes

Working days: Monday to Friday.
Reply time: Depending on the complexity of your support issue it's usually between a few hours to 48 hours.

Support is only guaranteed to paid subscribers

AdsManager - End of life

It is with great regrets that we have chosen to end the developpement of Adsmanager and its other associated components.

AdsManager is born 10 years ago and, as of today, the number of new subscriptions and downloads have fallen and we cannot maintain the component anymore.

All active subscribers will be able to continue enjoying support until the end of their subscription.

The components will be free and no support will be provided anymore for the other users.

×

Notice

The forum is in read only mode.

× OLD Forum post could be checked here : forum.joomprod.com

[RESOLVED]Editing default_list.php page for mobile

More
8 years 2 months ago - 8 years 2 months ago #24032 by ozyurt
I want to override default_list.php page for mobile version of my site.
Instead of using columns feature of adsmanager, I want to add just some field values like city, price, but not in a table.
When I use $content->ad_city in code, I get values like 1, 2 which are the values of multi select options. Instead I want to get the name of the ad_city like chicago.
How can I achieve this?
Last edit: 8 years 2 months ago by loic.
More
8 years 2 months ago #24039 by loic
Hello,

Use this code :
echo $this->field->showFieldValue($this->content,$this->fields['ad_city']);

Best regards.
The following user(s) said Thank You: ozyurt
More
8 years 2 months ago #24043 by ozyurt
Thanks for your help. I tried this code in default_list.php page, but it didn't work. But in default_jssor.php page, it worked. I don't understand the reason.
My code in default_list.php is as follows:
<div class="container-fluid">
 
<?php
foreach($this->contents as $content) 
{
    $linkTarget = TRoute::_( "index.php?option=com_adsmanager&view=details&id=".$content->id."&catid=".$content->catid);
    if (function_exists('getContentClass')) 
        $classcontent = getContentClass($content,"list");
    else
        $classcontent = "";
    ?>   
    <div class="mobilelist">
<h4 class="no-margin-top">
                    <?php echo '<a href="'.$linkTarget.'">'.$content->ad_headline.'</a>'; ?>
                    <?php if(!isset($this->conf->display_category_list_label) || $this->conf->display_category_list_label == 1): ?>
                        <span class="adsmanager-cat"><?php echo "(".$content->parent." / ".$content->cat.")"; ?></span>
                    <?php endif; ?>
                </h4>
            <?php
            if (isset($content->images[0])) {
                    echo "<a href='".$linkTarget."'><img class='fad-image' name='ad-image".$content->id."' src='".JURI_IMAGES_FOLDER."/".$content->images[0]->thumbnail."' alt=\"".htmlspecialchars($content->ad_headline)."\" /></a>";
            } else if ($this->conf->nb_images > 0) {
                    echo "<a href='".$linkTarget."'><img class='fad-image' src='".ADSMANAGER_NOPIC_IMG."' alt='nopic' /></a>";
            }
            ?>
            <div class="desc">
            <?php 
                $content->ad_text = strip_tags(str_replace ('<br />'," ",$content->ad_text));
                $af_text = JString::substr($content->ad_text, 0, 60);
                if (strlen($content->ad_text)>60) {
                    $af_text .= "[...]";
                }
                echo $af_text;
                echo ($this->field->showFieldValue($this->content,$this->fields['ad_city']));
 
            ?>
 
            </div>
</div>
<?php } ?>
 
</div>
More
8 years 2 months ago #24052 by loic
Hello,

In the list page, you must use '$content' and not '$this->content'. The correct syntax is this one :
echo ($this->field->showFieldValue($content,$this->fields['ad_city']));

Best regards.
The following user(s) said Thank You: ozyurt
More
8 years 2 months ago #24081 by ozyurt
Thanks a lot.
More
8 years 2 months ago #24105 by loic
You're welcome.

I update this topic to resolved.

Best regards.
Moderators: perry
Time to create page: 0.214 seconds
Powered by Kunena Forum