Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Hi, the fabulous team.

Time for me to set my portfolio folowing the tutorial.
I am at the point to configure the list view...
All was well, i can see the the static 'portfolio_list.html embed in 'portfolio.php'
but if i set

Code: Select all
<cms:if k_is_page >
  ....
<cms:else />
<cms:embed 'portfolio_list.html' />
</cms:if >


Access http://www.mytestsite.com/portfolio.php (it is the list-view because no page information is appended to the template name) and the contents of portfolio_list.html should appear -


The page is blank.
If i remove the code above, i can see again the the static 'portfolio_list.html embed in 'portfolio.php' . I am unable to find where is the problem.
Hi Coeur,

Can you check a few things:

1. Is your portfolio_list.html in the couch/snippets folder? (assuming you haven't renamed the couch folder)

2. Are you sure your portfolio_list.html file doesn't contain any PHP?

3. Does the portfolio_list.html file have any CMS:embed references that are not present in the same folder? (or have their paths set with site path variables?)

I think it is probably number 1. It is a bit confusing because you don't have to specify the path (which makes it look like it is in the same folder as the current file). ;)

Cheers,

Toby.
@Toby - your points are all valid but, in this case, I think @coeur2louve can see the embedded snippet alright when the k_is_page conditional is not present. So the probable reason could be the page-view/list-view stuff.

@coeur2louve
a. Please make sure that you have declared the template as clonable.
b. Create a couple of cloned pages first.
c. Let us forget the snippet for the time being and concentrate on the conditional first.
Begin by
Code: Select all
<cms:if k_is_page >
  <h1>I am a single page</h1>
<cms:else />
   <h1>I am the listing page</h1>
</cms:if >

Try accessing http://www.yoursite.com/portfolio.php - do you see the message 'I am the listing page'?
Try accessing a cloned page (click on the magnifying-glass icon) - do you see the message 'I am a single page'?

Once you make sure the conditional are working fine, start replacing the messages with real code.
Instead of embedding an snippet, try copy/pasting the code within the snippet right within the 'else' block as follows -
Code: Select all
<cms:if k_is_page >
  ...
<cms:else />
   .. directly paste the code from your snippet here ..
</cms:if >

Once this works, you can go back to the snippet.

Debugging is an inevitable part of any development process and the key here is to make incremental changes and test as you go.

Hope this helps. Please let us know.
Thanks.
Hello Guys,

Thaks for help.

As i follow the tuto, portfolio.php is set clonable
<cms:template title='Portfolio' clonable='1'> and potfolio_list.html is in the snippet folder, there is no other embed snippet or php code in it (portfolio_list.html).

I had already create 4 cloned test pages. All are in the admin panel. I can acces them from the admin panel (with an adress like
http://try.loc/porfolio.php?p=24)

In "portfolio.php" :

<cms:if k_is_page >
<h1>I am a single page</h1>
<cms:else />
<h1>I am the listing page</h1>
</cms:if >


Accessing "portfolio.php" the browser show a totaly white page with a nice I am a listing page

Accessing "porfolio.php?p=24" i can see the entire page (logo, menu, sidebar, pictures belonging to this page) and on the top left I am a single page
Well, we are almost there and if you replace the message with the embed, you should get the listing.

If you still have trouble, please PM me both the files (portfolio.php and portfolio_list.html) in zip form. There must be something just a little off somewhere in the code and I'll try to find it.

Thanks.
Hello again,

Having still trouble, i looked closely to the code. I found my silly mistake I didn't write correctly my masterpage : i set 'porfolio.php' instead of 'portfolio.php'

Maybe i drunk to much last week :lol:
:lol: Have a happy new year.
7 posts Page 1 of 1