krbhlp
August 24, 2015, 10:06pm
1
I have created a dfgo.com/category/feed/feed.txt file with the pre-set text here http://getkirby.com/docs/solutions/blog/rss Then I added a template called feed.php only with the pre-set php code (nothing else in the file), so here are the full file contents:
<?php
echo page('category')->children()->visible()->flip()->limit(10)->feed(array(
'title' => $page->title(),
'description' => $page->description(),
'link' => 'category',
));
?>
And I have downloaded the plugin and copied a folder named “feeds” to site/plugins folder. When I open dfgo.com/category/feed/ , it is a completely empty file (there is absolutely nothing on it, even in source). I have over 20 published posts in that category. Do I need some PHP extension or to do something else or maybe I’ve done something wrong in the first place?
Are those >20 published posts direct children of the “category” directory?
krbhlp
August 25, 2015, 2:57pm
3
They are in the folder content/category/posts.
Then your above code will not work, you need to add the subfolder
<?php
echo page('category/posts')->children()->visible()->flip()->limit(10)->feed(array(
'title' => $page->title(),
'description' => $page->description(),
'link' => 'category',
));
?>
krbhlp
August 25, 2015, 3:37pm
5
By “posts” I meant that there are the post folders in there, not a separate folder. Sorry for the confusion. Basically it looks like this: content/category/all-the-post-folders-here
Ok, that was a misunderstanding.
Is your plugin folder really called “feeds”? Then rename it to “feed”.
krbhlp
August 25, 2015, 3:54pm
7
Just renamed it - didn’t fix it.
Could you provide us with a screenshot of the folder structure of your ‘category’ directory?
krbhlp
August 25, 2015, 4:24pm
10
There you go enter link description here
The written “content” by me was supposed to be “category” - apologies for the mistake. But I think you get the picture either way.
You content files have to be for example:
content/category/1-folder-a/post.txt
content/category/2-folder-b/post.txt
and so on, if the template file is named “post.php
”.
Every folder name has to be different to all others, if you look after the leading number and the first “-
”.
anon77445132:
You content files have to be for example:
content/category/1-folder-a/post.txtcontent/category/2-folder-b/post.txt
and so on, if the template file is named “post.php”.
While this is true, it is irrelevant in the current context, because the template/s for the posts is not called.
The directories in the hardcopy have no name (only the leading sorting number and the “-
”)!
This is the main error, I think
I guess the titles were deleted for privacy reasons
I don’t guess and hope, that @krbhlp will help us with the truth…
krbhlp
August 25, 2015, 4:46pm
16
Yes, I removed the names for privacy reasons. They are all named as follows:
1-something/mytextyfilything.txt
2-dsjkfsd/awesome.txt, stuff.txt, here.txt
3-dskgf3ugf837/something.txt, else.txt
Etc.
You should not have multiple text files in your post folders . Don’t know if that’s the reason why it doesn’t work, but it will certainly lead to errors at one point or the other.
Why are there more than one *.txt
files in one directory?
Kirby needs, that every content file has it’s own directory.
Or are “the more than one *.txt files” namend e.g. pic001.jpg.txt
and the file pic001.jpg
is in the same directory?
krbhlp
August 25, 2015, 5:52pm
19
No, it’s more than one file. But there are folders with just one text file. I think they should be displayed properly then still?
I tested this a bit and it does not seem to be the reason for the error.
Is there nothing in the server php error log that might give a hint at what’s going wrong?