Support Forums

Displaying variables and extra fields NOT already shown on the page

This is a discussion on Displaying variables and extra fields NOT already shown on the page within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Try doing what I suggested. Suppress extrafields from being displayed and then use the extrafields plugin within your viewlisting template. ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 08-24-2010, 06:40 AM   #21
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,000
Rep Power: 74
seymourjames is a jewel in the rough
Default

Try doing what I suggested. Suppress extrafields from being displayed and then use the extrafields plugin within your viewlisting template. It should get you much of the way as far as the display of your listings.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds and Version 4 Templates
seymourjames is offline   Reply With Quote
Old 08-24-2010, 06:47 AM   #22
Customer
 
Join Date: Aug 2010
Posts: 100
Rep Power: 5
T0m1 is on a distinguished road
Default

Hi David,

Many thanks,

I am already taking a look at this and will report back with my findings.

Kindest regards,
__________________
Tom.

68c Developer v4.1.10 - Very Custom Template
MySQL v5.0.91-community <-> PHP v5.2.13 <-> Apache v2.2.15

Experience is the name we give to our mistakes
T0m1 is offline   Reply With Quote
Old 08-24-2010, 08:06 AM   #23
Customer
 
Join Date: Aug 2010
Posts: 100
Rep Power: 5
T0m1 is on a distinguished road
Default

Hi David,

Ok I can see how I can get this to work .

Slight question though

I altered the $price call before adding the custom extra field call, to do this
Code:
{if $price == '0.00'} To Give Away {elseif $price == '0.01'} SOLD {else} {$price|format_money}{/if}
Currently if I want to display ONO etc next to the price I would have to do the following
Code:
{if $price == '0.00'} To Give Away {elseif $price == '0.01'} SOLD {else} {$price|format_money} {get_extra_field id=$view fid=7}{/if}
This is not practical though and instead what id like to do is (btw ive tested this which obviously gave a smarty error);

[code]
{if get_extra_field id=$view fid=8 =='To Give Away'} To Give Away {else} {$price|format_money} {get_extra_field id=$view fid=7}{/if}
[code]

Now this creates an error as does {if (get_extra_field if=$view fid=8) =='To Give Away'}{/if}
This bit I know will not be an easy one but I do appreciate all and any help.

Kindest regards,
__________________
Tom.

68c Developer v4.1.10 - Very Custom Template
MySQL v5.0.91-community <-> PHP v5.2.13 <-> Apache v2.2.15

Experience is the name we give to our mistakes
T0m1 is offline   Reply With Quote
Old 08-24-2010, 09:13 AM   #24
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,000
Rep Power: 74
seymourjames is a jewel in the rough
Default

Confused and going round in circles here. You said you wanted to display the extrafields in different locations. Now you are trying to apply logical tests on the smarty plugin and it doesn't work as discussed unless you do as Mike was proposing and do it within the smarty plugin.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds and Version 4 Templates
seymourjames is offline   Reply With Quote
Old 08-24-2010, 09:21 AM   #25
curmudgeon
 
Join Date: Mar 2006
Posts: 5,360
Rep Power: 134
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Smarty is not as functional as pure PHP. What you will likely have to do is get an extra field and assign it to a new variable in the template and then compare that new variable to 'To Give Away'.

Something like....

{assign var='myvar' value=`get_extra_field id=$view fid=8`} <- backtics likely need to be used around value
{if $myvar == 'To Give Away'} To Give Away {else} {$price|format_money} {get_extra_field id=$view fid=7}{/if}
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 08-24-2010, 09:40 AM   #26
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,000
Rep Power: 74
seymourjames is a jewel in the rough
Default

Again, I do not wish to appear rude or awkward but offer honest advice, really I am trying to help you here as I have been there and got this t-shirt: you are trying to build a $20k website with an investment of $150 and a few hours of effort. It just does not work this way in terms of developing software or any business for that matter. I know; I am constantly in this position lacking many skills but I have learnt to avoid this. If I were you I would look at my goal seriously and scale it back to something you can do with the resources you have. Otherwise you will not be operational and still trying to do widgetry and bend the software to an application it was not designed to handle in a year's time. Everything you are trying to do is going to be complex because you are insisting on trying to make the software fit your goal rather than moderating your goal to fit the software given your constraints.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds and Version 4 Templates

Last edited by seymourjames; 08-24-2010 at 09:52 AM.
seymourjames is offline   Reply With Quote
Old 08-24-2010, 11:24 AM   #27
Customer
 
Join Date: Aug 2010
Posts: 100
Rep Power: 5
T0m1 is on a distinguished road
Default

Quote:
Originally Posted by Lhotch
Smarty is not as functional as pure PHP. What you will likely have to do is get an extra field and assign it to a new variable in the template and then compare that new variable to 'To Give Away'.

Something like....

{assign var='myvar' value=`get_extra_field id=$view fid=8`} <- backtics likely need to be used around value
{if $myvar == 'To Give Away'} To Give Away {else} {$price|format_money} {get_extra_field id=$view fid=7}{/if}
Hi Larry,

Many thanks for this. I have to admit that I keep forgetting about the smarty side of things. I will give your method a go, I have to admit I was playing around with the idea of using {php} tags to insert pure php code into the template, but thats me making things over complex.
Again many thanks, as I know I can be a bit demanding (as David is pointing out). Speaking of which I hope to make use of your membership module once I have accumulated enough funds to do so.

David,
I hear exactly what you are saying and please don't take me as an individual who wants and expects everything for nothing. If this was the case I could have opted for something that was free, but instead didnt because 68c had more credability not to mention a few experienced users.

Im not trying to be rude or ackward either, but I do think that , as an example, displaying an extra field where I want to instead of where the system says I have to, is something thats minor.
Now having a membership module or function or turning it into an auction site is something I strongly agree with you on in that it is a major change. Even your single checkout page I personally would see as being a big change.

Anyhow, I do not wish to fall out as it is only a matter of opinions at the end of the day and each one of us is entitled to one of those not to mention you have been a great help so far for which I cannot thank you enough.

Kindest regards and thanks to both of you ,
__________________
Tom.

68c Developer v4.1.10 - Very Custom Template
MySQL v5.0.91-community <-> PHP v5.2.13 <-> Apache v2.2.15

Experience is the name we give to our mistakes
T0m1 is offline   Reply With Quote
Old 08-24-2010, 11:53 AM   #28
Customer
 
Join Date: Aug 2010
Posts: 100
Rep Power: 5
T0m1 is on a distinguished road
Default

Quote:
Originally Posted by Lhotch
Smarty is not as functional as pure PHP. What you will likely have to do is get an extra field and assign it to a new variable in the template and then compare that new variable to 'To Give Away'.

Something like....

{assign var='myvar' value=`get_extra_field id=$view fid=8`} <- backtics likely need to be used around value
{if $myvar == 'To Give Away'} To Give Away {else} {$price|format_money} {get_extra_field id=$view fid=7}{/if}
Hi Larry,

Ive tried that bit of code, I placed the first bit into the tpl file (tried at the top before the main table and also within the same cell as the rest of the call).

The output is the price and the value of extra field id 7, but not the first part of the if statement which it should be.

I then changed the value just to double check etc but it always only outputs the price and x.field 7. I changed the backticks for ' but this made no difference. I have set the var='mytest' and the if statement calls for $mytest .

So it looks as though the whole call for {assign... is being ignored or not recognised?

Kindest regards,

Tom.
__________________
Tom.

68c Developer v4.1.10 - Very Custom Template
MySQL v5.0.91-community <-> PHP v5.2.13 <-> Apache v2.2.15

Experience is the name we give to our mistakes
T0m1 is offline   Reply With Quote
Old 08-24-2010, 11:57 AM   #29
curmudgeon
 
Join Date: Mar 2006
Posts: 5,360
Rep Power: 134
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

I wasnt sure if it would work or not. Basically what you asking it to do is take a value returned by a plugin and assign it to another template variable.

Your best bet, as I think has already been mentioned, would be to copy the plugin, rename it and alter it to do the logic and assign the valus to template vars there.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 08-24-2010, 01:28 PM   #30
Customer
 
Join Date: Aug 2010
Posts: 100
Rep Power: 5
T0m1 is on a distinguished road
Default

Hi Larry,

I will give this a go and see how everything goes.

Kindest regards,
__________________
Tom.

68c Developer v4.1.10 - Very Custom Template
MySQL v5.0.91-community <-> PHP v5.2.13 <-> Apache v2.2.15

Experience is the name we give to our mistakes
T0m1 is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
MODIFICATION: Display your extra fields on the showlistings.tpl page cwp Modules / Plugins / Modifications 28 08-06-2009 01:42 PM
extra fields in featured ads on home page rockabilly Technical Support 3 07-01-2009 06:02 AM
Extra Fields Showing Up On Search Page hotchops Technical Support 6 04-30-2009 10:34 PM
Extra Fields On View Listing Page dexignz Technical Support 1 09-23-2008 10:01 AM
extra fields on show results page anna245 Technical Support 3 04-18-2008 02:31 PM


All times are GMT -4. The time now is 12:16 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0