value minus value

More
10 years 11 months ago #42635 by days of summer
Replied by days of summer on topic value minus value
thanks for replying Mr ggppdk
i tried but there are no errors in the page
when i put the code in the template file it works well

but i want to show it inside a field
please help me as the whole website is now depending on that
thanks

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #42649 by days of summer
Replied by days of summer on topic value minus value
HELP PLEASE : (

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #42651 by ggppdk
Replied by ggppdk on topic value minus value
Hello

- the above code is very easy for me to add it to your custom template as column
... but to create a new field takes time, and don't want to hack existing fields

so let's do the first (the second (=create a new field will be done at an appropriate time and after some more thought/planning)

which template are you using ? a copy of the 'default' template?

you want this in category layout of the template or in item layout too ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #42657 by days of summer
Replied by days of summer on topic value minus value
thanks for replying Mr ggppdk
i am really lucky because you are here with us

i am using a copy of the default template

and it would be very good if the field is shown in the category and item view
but if i have to choose i will need it to be in the category view in the first priority

thanks for helping us Mr ggppdk

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #42662 by ggppdk
Replied by ggppdk on topic value minus value
Hello

for category layout of blog template

edit
category_items.php
category_items_html5.php

-- 1 --
Add a new column title:
Code:
<th scope="col"><?php echo JText::_('My column title'); ?></th>

Add above code
before or after:
<?php foreach ($columns as $name => $label) : ?>
<th id="field_<?php echo $name; ?>" scope="col"><?php echo $label; ?></th>
<?php endforeach; ?>




-- 2 --
Add the data:
Code:
<?php $field_id1 = 55; $field_id2 = 55; $flds_arr = & $item->fieldvalues; echo $flds_arr[$field_id2][0] - $flds_arr[$field_id1][0];

Add the above
before:
<!-- BOF item fields -->
or after:
<!-- EOF item fields -->


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #42745 by days of summer
Replied by days of summer on topic value minus value
i used it and i worked well
thanks Mr ggppdk (Y) (Y) (Y)
it was not shown inside the table
so i added a
<td></td> tag
before and after and it works well now !

can i ask another question please ...
is it possible to show the sum of their values ?

you taught me how to do that when i deal with fields

but now i don't know if it is possible to show the sum of the results ؟

this is example of what i mean

this is the column ( you helped me with )
it has its values under it



can i show the sum of them in the category view ?

many thanks

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.405 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline