Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue using plugin #4

Closed
zisiyan opened this issue Jun 15, 2019 · 7 comments
Closed

Issue using plugin #4

zisiyan opened this issue Jun 15, 2019 · 7 comments
Assignees
Labels
bug Something isn't working can't replicate

Comments

@zisiyan
Copy link

zisiyan commented Jun 15, 2019

Hey, I'm new to Grav and I have been having a lot of trouble using plugins.

I read through the readme.md but I still can't understand how you actually apply the plugin into my website. I have added the timeline.html.twig file into my templates file.

I want to make a md file for it and add into my webpage, but I don't know how.

Thanks for the help and sorry for any inconveniences. :(

@OleVik
Copy link
Owner

OleVik commented Jun 15, 2019

You don't need to add timeline.html.twig to your own templates, unless you want to change it, as the plugin makes them available for your installation of Grav. You'll instead want to do the following:

  1. Create a Page for your Timeline, for example a folder like /user/pages/mytimeline
  2. In this folder, create a file named timeline.md
  3. Edit this file like any normal Page in Grav: Add some FrontMatter and Content (example)
    • This is your actual Timeline, but not the Events within it
  4. For each Event in the Timeline, create a subfolder, like /user/pages/mytimeline/myevent
  5. In this folder, create a file named timeline_event.md
  6. Edit this file like any normal Page in Grav too: Add FrontMatter and Content (example)

For a full example, that you can download and edit or just browse through, take a look at the Timeline Skeleton - especially the Pages therein. The Skeleton also shows that you can nest Timelines within Timelines, as long as there are Events at the lowest level.

@OleVik OleVik added the question Further information is requested label Jun 15, 2019
@zisiyan
Copy link
Author

zisiyan commented Jun 16, 2019

Thanks for the reply OleVik! :)

Sorry, still kind of confused with it's usage. I have created the folders with the markdown files in them. But when I'm at the admin dashboard, the timeline pages that I've created linked themselves to a random twig file, eg: blog.html.twig as its page template.

I'm currently using grav-skeleton-timer as my skeleton. So wanted to add the plugin in as one of my pages. Would appreciate it if you can explain how to do that. :)

@OleVik
Copy link
Owner

OleVik commented Jun 16, 2019

I ran through this:

  1. Install latest Timer Skeleton, update Grav Core to v1.6.10.
  2. Install latest stable Admin, v1.9.6, and latest stable Timeline, v1.3.1.
  3. Go to Admin and create a new Page, using Timeline as the template:

image

3a. Add a subtitle and some content.
3b. Save the Page:

image

  1. From the same Page (http://timeline.local/admin/pages/my-timeline), add a new Page, using Timeline Event as the template and "My Timeline" as Parent Page:

image

4a. Add some content.
4b. Save the Page:

image

  1. Visit the site, click the link "My Timeline" in the top navigation:

image

  1. The Timeline with Event(s) renders:

image

In essence, make sure you choose the right Page Template when creating Timelines and Events in Admin. In the filesystem they will be timeline.md and timeline_event.md which correspond to timeline.html.twig and timeline_event.html.twig, respectively, which the Plugin makes available.

@zisiyan
Copy link
Author

zisiyan commented Jun 17, 2019

Thanks for the reply again!

I followed your steps, updating all the things needed. But when it comes to creating a page, I can't set my page template as timeline without copy pasting the timeline.html.twig file into my templates folder first... :/

without

So I copied the file along with the ones in partials and macro into my templates folder, and I get this:

withjpg

So I select timeline as my page template, but the page does not contain the functions like from your pictures:

inside

So to add the content, I clicked on expert mode and added my content there:

edit

But when I load my webpage, this comes up:

page

As you can see, the title and the subtitle pops up, but the paragraph text doesn't. :/

Then I created my timeline_event.md page and placed my timeline.md as it's parent page. But it does not show up either, like the paragraph text.

I think I missed out an important step. Would appreciate if you could walk me through this. :) And thanks again for helping me out with this!

@OleVik
Copy link
Owner

OleVik commented Jun 17, 2019

What version of Grav Core and Admin do you have installed?

@zisiyan
Copy link
Author

zisiyan commented Jun 18, 2019

The latest one which is Grav Core v1.6.10. and Admin Plugin v1.9.6

@OleVik
Copy link
Owner

OleVik commented Jun 18, 2019

What theme are you using? The blueprints or templates are not registering, which is likely due to some conflict with another plugin or theme. In a clean installation of Core v1.6.10, Admin v1.9.6, and Timeline v1.3.1, it works as expected.

@OleVik OleVik added bug Something isn't working can't replicate and removed question Further information is requested labels Jun 18, 2019
@OleVik OleVik self-assigned this Jun 18, 2019
@OleVik OleVik closed this as completed Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working can't replicate
Projects
None yet
Development

No branches or pull requests

2 participants