Removing "View Journal | Current Issue | Register"

Can anyone advise whether it is possible to remove the “View Journal | Current Issue | Register” from underneath each journal description on the home page? I’m hoping for a configuration solution, not one that requires changing the code.

Thanks.

Hi @bernieh,

Your options for hiding those links are either to modify the template (see templates/index/site.tpl) or to upload a CSS file that applies a display:none style to that markup.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Thanks, Alec. Unfortunately the CSS strategy doesn’t work, as the class=“action” used in the HTML applies also to some other items in the template; and it also doesn’t pick up the pipes between the links.

How about:

.journalDescription + p { display: none; }

?

1 Like

Thanks, ctgraham; still no go, though :frowning:

I agree with the method suggested by both @ctgraham and @asmecher . you can do it by css. Here is your answer.
Go to /lib/pkp/styles/common.css here add this code ( I added it at the bottom)-

p.no_p { display: none;}

Save the file, now again go to /templates/index/site.tpl
Here at Line#46 (In my case) add your CSS Class to your paragraph tag like this and save

and the result is from-

to

Thanks, John. These instructions do work; but problem is that we’d need to edit existing OJS code. We need a solution that would work purely via a stylesheet that we upload. This is because we have a policy of “no code customisation” (a result of past experience with this causing us huge maintenance issues).

I can get around the need to tweak common.css by uploading a separate stylesheet via Site Admin - Site Settings - Site Style Sheet. But this still leaves the need to tweak site.tpl.

@bernieh
Without doing the above method I don’t think there is any other method for your solution, because the paragraph tag used in that code is a common paragraph tag for other pages as well, so I think if you will make a change in your paragraph tag of your CSS, It will affect all other paragraphs tag using it as well. This was the reason I made a separate class “no_p” and called it in site.tpl. (You can also add this class at your custom made CSS as well but again you have to call it at site.tpl)
Still I respect your “No Code Customization” policy. I will advice you If it is Ok to add a line in your CSS and edit a line in site.tpl works with you then go ahead, but at the same time taking in mind with your past experiences with customization,still I will respect your policy.

@bernieh, how familiar are you with CSS? There is likely some combination of CSS which can target the <p> tags based on child and/or sibling selectors.

It looks like my solution of .journalDescription + p is only available in the latest stable 2.4.7. What version are you running?

Alternately, depending on how committed you are to removing the text without changing the code, you could inject a bit of javascript via the Site Settings title or Introduction.

The Site Settings title does not escape HTML properly, and you could sneak in a javascript call to remove the p tags in the onLoad event. I consider this a bug, and hope it would be fixed, and so this would likely be an unstable solution in the long term.

The TinyMCE tool for the Introduction seems to accept script tags, but also does some incorrect reformatting of the content. Particularly, when I tested 2.4.7 just now to manually insert javascript via the raw HTML editing window, it added a // CDATA [ container, but it also replaced linebreaks with <br>s. I was able to execute a script by terminating each line with a //:

<script type="text/javascript">// <![CDATA[
$(document).ready( function () { window.alert('ok'); } );//
// ]]></script>

becomes:

<script type="text/javascript">// <![CDATA[<br />
$(document).ready( function () { window.alert('ok'); } );//<br />
// ]]></script>
1 Like

Thanks, Graham, we are on 2.4.3.

I don’t think we are so stuck on removing the “View Journal…” text that we’re willing to go the javascript route, though.

BUT it may well be that we’ll be willing to go that route for some other tweaks in the future. So I’m very happy to know about your solution, and will keep it in mind for our next request. I’ve tested your approach in the Introduction field, at it works fine. Thanks so much for your help :slight_smile: