All questions about EDocman extension

Other Indicators

  • Everaert Geert
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 10 months ago #46032 by Everaert Geert
Other Indicators was created by Everaert Geert
How can i add other indicators (hot, featured, ...) in EdocMan?

Tx

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

More
9 years 10 months ago #46065 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Other Indicators
Hi

Unfortunately, at the moment, we only support the two indicators (hot, featured). You canno add other indicators unless you customize the code.

Regards,

Tuan

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

More
9 years 9 months ago #46600 by Peter Haken
Replied by Peter Haken on topic Other Indicators
Where would we do this then please? Thanks

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

More
9 years 9 months ago #46601 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Other Indicators
Hi Peter

It is not easy. Below are the steps :

1. Open the file administrator/components/com_edocman/models/forms/document.xml, find the xml code below and add the other indicators you want to:
Code:
<field name="indicators" type="list" label="EDOCMAN_INDICATORS" description="EDOCMAN_INDICATORS_DESC" required="false" multiple="true" size="2"> <option value="hot"> EDOCMAN_HOT</option> <option value="featured"> EDOCMAN_FEATURED</option> </field>

2. The next step is customizing code to display these indicators in document details page

The file you need to modify is components/com_edocmans/views/document/tmpl/default.php. Look at that file and you will see code which display indicators and can customize it to meet your need.

Tuan

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

More
9 years 9 months ago - 9 years 9 months ago #46613 by Peter Haken
Replied by Peter Haken on topic Other Indicators
Step 1 I have added this
<field
name="indicators"
type="list"
label="EDOCMAN_INDICATORS"
description="EDOCMAN_INDICATORS_DESC"
required="false"
multiple="true"
size="2">
<option
value="hot">
EDOCMAN_HOT</option>
<option
value="sold">
EDOCMAN_SOLD</option>
<option
value="For Sale">
EDOCMAN_FORSALE</option>
<option
value="Under Offer">
EDOCMAN_UNDEROFFER</option>
<option
value="featured">
EDOCMAN_FEATURED</option>
</field>

Trying to do step2 added this
<?php echo $item->title; ?>
<?php
if($item->indicators != '')
{
$indicators = explode(',', $item->indicators);
?>
<span class="indicators">
<?php
if(in_array('featured', $indicators))
{
?>
<span class="edocman_featured">
<?php echo JText::_('EDOCMAN_FEATURED');?>
</span>
<?php
}
if(in_array('for sale', $indicators))
{
?>
<span class="edocman_forsale">
<?php echo JText::_('EDOCMAN_FORSALE');?>
</span>
<?php
}
if(in_array('hot', $indicators))
{
?>
<span class="edocman_hot">
<?php echo JText::_('EDOCMAN_HOT');?>
</span>
<?php
}
?>
</span>
<?php
But will not show in an entry?
Last edit: 9 years 9 months ago by Peter Haken.

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

More
9 years 9 months ago #46638 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Other Indicators
That's strange. You can submit a support ticket sending us admin and FTP account of your site so that I can check to see what's wrong and get it corrected for you .

Regards,

Tuan

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

More
9 years 9 months ago - 9 years 9 months ago #46724 by Peter Haken
Replied by Peter Haken on topic Other Indicators
Pm you
Last edit: 9 years 9 months ago by Peter Haken.

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

More
9 years 9 months ago #46735 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Other Indicators
OK Peter. I received your support ticket. We will have a dev working on it for you on tomorrow morning

Regards,

Tuan

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

More
9 years 9 months ago #47251 by Peter Haken
Replied by Peter Haken on topic Other Indicators
Hi I asked about what I did wrong when adding the code, though you could not comment as I need to add 2 more indicators.
I have added that text and again did not work, what am I doing wrong??? I have already PM you access details do you still have them? You will have to let me know when developers can access via FTP as will need to unlock the domain name, I will unlock now for 4 hours max.

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

More
9 years 9 months ago #47256 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Other Indicators
Hi Peter

Last time, I had to assign the task to my dev because I am too busy, so I could not check and could not tell you what's wrong. My dev just fixed that for you.

Since you asked for the reason of the error, I did a quick check (it is 11:40pm now and I could not spend much time checking it), I found that the code you added lack some "}" character in the if command. Before I fix your code, you won't be able to see the document detail page.

I haven't checked all the indicators you added, but it should be good enough for you to check the code now as the document detail page is now showed.

Please try to check it yourself. If you cannot find out what's wrong, please leave a message here and I will check it when I come to office on tomorrow morning.

Tuan

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

Moderators: Mr. Dam