OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



What .tpl file can I look this code?

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Re: What .tpl file can I look this code?

Postby cristianviza » Fri Jun 07, 2013 3:21 pm

Hello asmecher .
Not exactly what I want, the question is because I this by modifying the code of ojs, to take another look at the page(http://www.subimelafoto.com.ar/visualizer.php?url=666snapshot5.png) . And wanted to know how to display the magazines to put in another structure.
in site.tpl comment
<! - {iterate from = journals item = journal} ->
but it still shows all the journal published, and do not want that.
What variable holds the names of the journal so I can go with php and displaying iterating that I want.

Thanks
Best Wishes
Cristian
cristianviza
 
Posts: 74
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: What .tpl file can I look this code?

Postby asmecher » Fri Jun 07, 2013 5:17 pm

Hi Cristian,

Take a look at templates/index/site.tpl. There is a loop that looks like this:
Code: Select all
{iterate from=journals item=journal}
    ...
{/iterate}
Everything inside (... in this example) is repeated for each journal.

If you want to have only one (or a few) journals listed, you could do e.g.:
Code: Select all
{iterate from=journals item=journal}
{if $journal->getPath()=='journal-one' || $journal->getPath()=='journal-two'}
   ...
{/if}
{/iterate}
This would change the listing to include only the journals with paths "journal-one" and "journal-two".

If you just want to change the way that the journals are displayed, e.g. to show a tiled set of images, you can do that by changing the contents of the {iterate} loop and the code enclosing it to something along these lines: http://www.cssbakery.com/2010/07/image- ... _6950.html

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8321
Joined: Wed Aug 10, 2005 12:56 pm

Re: What .tpl file can I look this code?

Postby cristianviza » Mon Jun 10, 2013 2:39 pm

Hi Asmecher, Yes I am now more aimed :)

My idea is:

delete this line:
Code: Select all
{iterate from=journals item=journal}
...
<!-- do something -->
...
{/iterate}


replace for
Code: Select all
{while $NumberJournal < XXX}
  ...
<!-- do something -->
..
{$NumberJournal--}
{/while}


but I don't know how obtain number of journals published.
How I do get the number ?

Thanks
cristianviza
 
Posts: 74
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: What .tpl file can I look this code?

Postby asmecher » Mon Jun 10, 2013 2:50 pm

Hi Cristian,

Is the idea to present the list of journals in reverse order, or to exclude lower journals below a certain "number" (I suspect you mean journal ID)?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8321
Joined: Wed Aug 10, 2005 12:56 pm

Re: What .tpl file can I look this code?

Postby cristianviza » Mon Jun 10, 2013 3:12 pm

I attached link my code site.tpl

https://docs.google.com/document/d/1XgDXH1GeSpgEtUi7FwEF8xVRTNmDwQyQhhRQHqe9VHI/edit?usp=sharing

but this code the magazines do not show me, show me a blank page :( .
I want use while instead iterate .
cristianviza
 
Posts: 74
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: What .tpl file can I look this code?

Postby asmecher » Mon Jun 10, 2013 3:35 pm

Hi Cristian,

OK, but what will a foreach loop allow you to do that the existing {iterate} won't? Embedding PHP blocks in Smarty templates that interact with Smarty variables is a pain, and it might be unnecessary.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8321
Joined: Wed Aug 10, 2005 12:56 pm

Re: What .tpl file can I look this code?

Postby cristianviza » Mon Jun 10, 2013 4:01 pm

Hello Asmecher :) . because I want to put the journal in linking to a list on a slider, in which I can put on each slider only 8 journals and divided with divs . Slider code example : https://docs.google.com/document/d/16d8MVPRcg5AiTcV7timscKbcOYVWCWmf4fDKWY0m9ig/edit?usp=sharing
:)
cristianviza
 
Posts: 74
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: What .tpl file can I look this code?

Postby asmecher » Mon Jun 10, 2013 5:02 pm

Hi Cristian,

At a glance, I don't see anything there that the {iterate} call isn't already taking care of; I suspect what you're missing is experience with Smarty syntax. I'd suggest doing some reading at http://www.smarty.net/docsv2/en/. (The {iterate} call itself is an OJS-specific extension, but it's basically equivalent to a {foreach} loop.)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8321
Joined: Wed Aug 10, 2005 12:56 pm

Re: What .tpl file can I look this code?

Postby cristianviza » Tue Jun 18, 2013 1:29 pm

cristianviza
 
Posts: 74
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: What .tpl file can I look this code?

Postby asmecher » Tue Jun 18, 2013 1:33 pm

Hi cristianviza,

Glad to hear it's working! I suspect you could clear up some of the PHP code by using Smarty functions instead ({if}, {assign}, etc.) but that's just points for style.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8321
Joined: Wed Aug 10, 2005 12:56 pm

Re: What .tpl file can I look this code?

Postby darryl » Mon Sep 16, 2013 2:31 pm

asmecher wrote:Hi Darryl,

It's a little tougher to debug without being able to see it myself, but I'll see what I can do. You've modified the template file, but you see no change, correct? If so, could you double-check that the web server has permission to administer all the files in templates/t_compile?

Regards,
Alec Smecher
Public Knowledge Project Team



Hi Alec,

I'll Back on this topic again. What you writeup above is the templates/t_compile? where can i see this?

regards,

Darryl
darryl
 
Posts: 64
Joined: Wed Jul 04, 2012 6:52 pm
Location: Cagayan de Oro , Misamis Oriental Philippines

Re: What .tpl file can I look this code?

Postby asmecher » Mon Sep 16, 2013 3:49 pm

Hi Darryl,

templates/t_compile is a subdirectory of your OJS installation directory.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8321
Joined: Wed Aug 10, 2005 12:56 pm

Re: What .tpl file can I look this code?

Postby darryl » Tue Sep 17, 2013 7:04 am

asmecher wrote:Hi Darryl,

templates/t_compile is a subdirectory of your OJS installation directory.

Regards,
Alec Smecher
Public Knowledge Project Team


Hi Alec,

can you help where can i see the .tpl on this.

regards,
Darryl
Attachments
JM.PNG
Not Viewing the manager/index.tpl
JM.PNG (24.23 KiB) Viewed 380 times
darryl
 
Posts: 64
Joined: Wed Jul 04, 2012 6:52 pm
Location: Cagayan de Oro , Misamis Oriental Philippines

Re: What .tpl file can I look this code?

Postby asmecher » Tue Sep 17, 2013 8:56 am

Hi Darryl,

This isn't something you can see by exploring the OJS interface -- you need to use FTP, SSH, or a web-based file manager.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8321
Joined: Wed Aug 10, 2005 12:56 pm

Re: What .tpl file can I look this code?

Postby darryl » Tue Sep 17, 2013 11:55 pm

asmecher wrote:Hi Darryl,

This isn't something you can see by exploring the OJS interface -- you need to use FTP, SSH, or a web-based file manager.

Regards,
Alec Smecher
Public Knowledge Project Team


What do you mean the FTP accessing to explore my OJS Interface?.
darryl
 
Posts: 64
Joined: Wed Jul 04, 2012 6:52 pm
Location: Cagayan de Oro , Misamis Oriental Philippines

PreviousNext

Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 8 guests