No "edit article" icon...

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Mon Sep 16, 2013 1:57 pm
Reply with quote
Report this post
On my template installation there is no frontend icon to edit an article for logged in users (publisher).

I tried to set another template (protostar) as default for testing and everything works fine...
User avatar
Fresh Boarder

teitbite
Wed Sep 18, 2013 4:42 am
Reply with quote
Report this post
Hi

Please show me Your site and send me an access so I'll be able to check it myself.
User avatar
Moderator

teitbite
Fri Sep 20, 2013 3:33 am
Reply with quote
Report this post
Hi

That's strange. Have You made any changes to /html/com_k2/default/item.php ? In a clean template I can see a code for this icon present. Try add it manually to the file I've mentioned:

Code: Select all
            <?php if(isset($this->item->editLink)): ?>
            <a class="itemEditLink modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $this->item->editLink; ?>"><?php echo JText::_('K2_EDIT_ITEM'); ?></a>
            <?php endif; ?>
User avatar
Moderator

GK User
Fri Sep 20, 2013 6:40 am
Reply with quote
Report this post
Hi,

I am not even using K2 on this site ;-)

But if I activate e.g. the "print" icon in the backend, the print icon is visible AND the edit article icon too - but if I do not want to display any of these informations (like author, create date, etc.) the edit article icon does not show up...

Maybe some php "if" clause?
User avatar
Fresh Boarder

teitbite
Sat Sep 21, 2013 1:34 am
Reply with quote
Report this post
Hi

Sorry. I assumed it's a K2 article. In regular joomla articles this code is responsible for edit link:

Code: Select all
               <?php if ($canEdit) : ?>
                  <?php echo preg_replace('@<img.*?alt="(.*?)".*?\/>@mis', '$1',JHtml::_('icon.edit', $this->item, $params)); ?>
               <?php endif; ?>


it is in /html/com_content/article/default.php

so I believe problem is with:

Code: Select all
<?php if ($canEdit) : ?>


Please try change this part to:

Code: Select all
                  <?php echo preg_replace('@<img.*?alt="(.*?)".*?\/>@mis', '$1',JHtml::_('icon.edit', $this->item, $params)); ?>


This way link will be visible for all users, but it will help us to check if problems is a link itself or a condition. Just check if link appeared and change it back, so I'll come up with a replacement for condition.
User avatar
Moderator

GK User
Sat Sep 21, 2013 8:33 am
Reply with quote
Report this post
Hi,

that did not do the trick.

In line 92:

Code: Select all
      <?php if (
         $params->get('show_create_date') ||
         $params->get('show_publish_date') ||
         $params->get('show_modify_date') || 
         ($params->get('show_parent_category') && $this->item->parent_slug != '1:root') ||
         $params->get('show_print_icon') ||
         $params->get('show_email_icon') ||
         $params->get('show_category') ||
         $params->get('show_hits') ||
         ($params->get('show_author') && !empty($this->item->author))
      ) : ?>


I had to add $canEdit, and it works:

Code: Select all
      <?php if (
         $params->get('show_create_date') ||
         $params->get('show_publish_date') ||
         $params->get('show_modify_date') || 
         ($params->get('show_parent_category') && $this->item->parent_slug != '1:root') ||
         $params->get('show_print_icon') ||
         $params->get('show_email_icon') ||
         $params->get('show_category') ||
         $params->get('show_hits') ||
         ($params->get('show_author') && !empty($this->item->author)) ||
         $canEdit
      ) : ?>


Cheers,
Thorsten
User avatar
Fresh Boarder

teitbite
Sat Sep 21, 2013 11:22 pm
Reply with quote
Report this post
Hi

Great to hear that, but to be honest I'm a little bit confused becuase my code in this file looks a lot different. Are You sure You have posted Your question in the right template section and that it was updated to the latest version ?
User avatar
Moderator

GK User
Sun Sep 22, 2013 10:25 am
Reply with quote
Report this post
mhhh,

I have installed gk_creativity_J!3.zip
and version is 3.9.1
User avatar
Fresh Boarder

teitbite
Sun Sep 22, 2013 6:32 pm
Reply with quote
Report this post
Hi

Ok. I think I know what was wrong. An edit button was meant to be seen next to print or mail. Probably if none of this icons was set to display an edit was not visible as well. Anyway You have fixed it, so nothing to worry about now. I'll let programmers know about this small fix.
User avatar
Moderator


cron