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 / Not show the duplicate name of category and sub

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

Not show the duplicate name of category and sub

More
11 years 5 months ago #11855 by loic
Hello,

Sorry for the late reply.

You can hide the parent cetagory by removing the line 194 in the file 'components/com_adsmanager/helpers/category.php':
$parent .= $p['name'].$options['separator'];

Best regards.
More
11 years 5 months ago #11860 by francota
Hello loic

I attach an image to show you what happens using your solution, I think it is a good start but not enought :blush:
Other ideas??

Thanks
BYe
FRank

Attachment doppia_categoria2.jpg not found

Attachments:
More
11 years 5 months ago #11869 by loic
Hello,

Just a question, you wish to hide the parent category, is that correct ?

Best regards.
More
11 years 5 months ago #11870 by francota
Hello
First of all I link an old post in this forum so you can remember why I created category and sub with same name, i dont want you think i am crazy :cheer: :
www.joomprod.com/forum/main-forum/2424-s...on-only-one-category

After that, my porpuse is to have just one category "Esposizioni" to not make confusion for user, that means for me it is not important what if main category or sub.

Thanks
FRank
More
11 years 5 months ago #11882 by loic
Hello,

Then we can do something like that in the file 'components/com_adsmanager/helpers/category.php' line 208 (more or less), replace that:
?>
    <option <?php echo $attribs; ?> <?php echo $selected?> value="<?php echo  $cat->id?>"><?php echo htmlspecialchars($optionlabel); ?></option>
<?php 

By that:
if($parentName != $cat->name) {
?>
    <option <?php echo $attribs; ?> <?php echo $selected?> value="<?php echo  $cat->id?>"><?php echo htmlspecialchars($optionlabel); ?></option>
<?php 
}

Then line 194, juste after that:
$parent .= $p['name'].$options['separator'];

Add this line :
$parentName = $p['name'];

and to avoid any error, just before le 'foreach' line 193, add that:
$parentName = '';

It will hide every categories that have the same name as their parent categorie.

Best regards.
More
11 years 5 months ago #11899 by francota
Hello Loic

Your code works for half :blush:
I mean it hides the category with same name in drop down menu, how you can see the image
, but it hides all category when I add new AD.
I attach 2 images, the first shows how it hides the category with same name(it is ok), and the second shows how it hides all category when I add a new add.

Frank

Attachment ok_category_view.jpg not found



Attachment nowors_insertads.jpg not found

Attachments:
Moderators: perry
Time to create page: 0.109 seconds
Powered by Kunena Forum