How to suppress "Back to Pinboard" in Public View?

Currently there is a link “Back to Board” in public task view.

Me and also others are not happy with that, which offers access to complete project via public link for 1 single task.

Is there a simple possibility to suppress that “Back …” link in public view?

CU

Rainer

Simple? No. This needs a change in KB code base, and you’ll have to apply this after every upgrade. Or you write a plugin…

Quick&dirty™:

  1. Create a copy of file /app/Template/task/details.php, name it e.g., details_pub.php.
  2. Remove the link section from your details_pub.php.
                         </small>
                     </li>
                     <?php endif ?>
-                    <?php if ($project['is_public'] && !$editable): ?>
-                    <li>
-                        <small>
-                            <?= $this->url->icon('th', t('Back to the board'), 'BoardViewController', 'readonly', array('token' => $project['token'])) ?>
-                        </small>
-                    </li>
-                    <?php endif ?>
 
                     <?= $this->hook->render('template:task:details:first-column', array('task' => $task)) ?>
                 </ul>
  1. Edit the file /app/Template/task/public.php as follows.
 <section id="main" class="public-task">
-    <?= $this->render('task/details', array(
+    <?= $this->render('task/details_pub', array(
         'task' => $task,
         'tags' => $tags,
         'project' => $project,

Maybe it’s a good idea to backing up the files before modifying them.
No Warranty, it’s fully up to you. Good luck!

1 Like

Hi Alfred, that’s the direction I was thinking about.

I have a test installation and will try to comment out lines in details_pub.php and modify line in public.php. We will see …

And of course, I will share my results here.

CU

Rainer

According to my experience, commenting out in templates will often fail. Be prepared.

In a Test project I did the modifications as per your suggestions. I deleted lines, did not comment out.

Seems to do nothing, as you should see in Task1 and Task2

Task2 I created after modifications due to your suggestions.
Before I created Task 2

  1. ./.
  2. ./.
  3. Relaunched Browser

Then
4. Opened Browser → Created Task2 → Opened Task → Clicked “Public Link”.
» “Back to Pinboard” shown

Before I created Task1
11. renamed details.php to details_.php
12. renamed details_pub.php to details_pub_.php
13. Relaunched Browser

Then
14. Opened Browser → Created Task1 → Opened Task → Clicked “Public Link”.
» “Back to Pinboard” shown

My Question: Are the modifications something that should have influence for creation of new tasks, but existing tasks will beshown (in public view) as before the modifications? Or should modifications have impect on public view on existing tasks?

I don’t fully understand your question. The template details.php is also used for the “normal” task display. If the modification doesn’t work on your side, then either you modified the wrong files or there is some PHP caching in effect. Here it was working on the 1st run.