Sommerregen / grav-theme-machine

This theme is a Grav port of the Machine HTML Template (http://w3layouts.com/machine-industrial-category-flat-bootstrap-responsive-web-template/) developed by W3Layouts (http://w3layouts.com/).
Other
7 stars 3 forks source link

Grav - Machine Theme - Home Page Clients Module #1

Closed f1209 closed 8 years ago

f1209 commented 8 years ago

I have a couple of issues with the Machine Theme on Grav:

Homepage - Clients Module

/home/_clients/mirem-ipsum-usa client

  1. Markup does not seem to work - I cannot get line breaks
  2. I edited the title 'Kind words from clients' to 'Words of a Poet' but the change does not
  3. When I create a new module - the page defaults to being a blog post and not a client module
  4. The quote box around the comments - I do not know where to adjust the css to fit around the quote well

If anyone could help, that would be great. Thank you.

Notes about me:

Not a coder Know enough to locally edit and file and upload via ftp Using Grav so I can do easy CMS updates If something is not working, it may be me not knowing what I am doing

Page I am editing is www.sevensistersroad.com php 5.6

Sommerregen commented 8 years ago

Hi @f1209 ,

I'll see how I can help you. Converning

  1. What does not work? Usually you just type in Markdown formatted content. The Admin plugin can help you here. For getting linebreaks you need two newlines instead of just one.
  2. Usually if you change the title, your page should have new title, too. There are however some settings, why you don't see the change (which are mostly for beginners not obvious). i) You may check that you copied the demo content frome here to your user/pages directory. ii) You may check, whether cache is turned on. Otherwise turn it off for the moment and clear the cache (either via Admin panel) or by deleting the contents of the cache folder. iii) There are some typos you made and your page header in YAML format is not valid. Please double check.
  3. This is may be more or less an issue with the Admin plugin. I don't know how to set a page template to the default ones selected. This can maybe done with a custom blueprint (but that requires advanced knowledge) and I actually don't know how to do it. If you think that's a pressing issue for you, I recommend you to open an issue in the Admin plugin issue tracker.
  4. Sorry, unfortunately I have no live example of a site with a comment to test. But I'm pretty sure, that you will find it on your own. Every webbrowser has a developer console i.e. Firefox right-click -> inspect element. You can then see the applied styles for the quote box and modify them. You can further have a look. All CSS files are located in this folder and the e.g. the styling for the box is done here. You just need to overwrite or modify those styles. Basically I recommend you to delete the background property for the label and use

    .item-in p {
    border: 2px solid #fff;
    margin: 0 auto;
    width: 74%;
    font-size: 1.4em;
    color: #a8a8a8;
    padding: 2.5em;
    line-height:1.5em;
    position: relative;
    }
    
    .item-in p:after {
    background: rgba(0, 0, 0, 0) url("http://www.sevensistersroad.com/user/themes/machine/assets/images/in.png") no-repeat scroll -4px 0;
    content: " ";
    height: 34px;
    left: 50%;
    margin-top: -5px;
    position: absolute;
    top: 100%;
    width: 25px;
    }

    instead.

f1209 commented 8 years ago

Thanks very much for your responses. I think there may be some issues with how the template interacts with Grav. I love the template but when I use Grav CMS admin to make changes, some changes do not happen, markup is ignored, and the modules especially do not work as they should.

All I have done is edit the existing homepage after I copied it over to my server in the user/pages folder. I edited photos and content but have not edited any coding.

I deleted the cache but the issues remain.

  1. On the Clients module - whatever I try for line breaks using markup does not work. I have edited on the admin panel and directly on the files themselves and cannot get line breaks. When I did this on other modules (eg staffing), it worked fine.
  2. I did not edit any coding so if anything is wrong, (YAML header) it was wrong in the original coding. I still cannot change the module title 'Kind words from Clients' to my title 'Words of a Poet' either using the Admin panel or directly on the file on the server.
  3. I tried creating a new Client module but it does not show up in the live site. The options of the page for Display Template do not show clients - it just shows, Blog, blog post, contact, default, error, modular, products, services.
  4. If I can get the quotes to work, I can probably figure out the CSS.

Thanks again for your help. I really appreciate it. The problems may just be that I'm doing something wrong, but the admin panel is not doing what I would have expected it to enable for me.

Sommerregen commented 8 years ago

Hi @f1209 ,

your questions are totally valid and right to ask. I'm not really familiar with theme either, since I took the maintership recently, but I'll do what I can. Concerning

  1. I figured it out. You haven't done something wrong. Linebreaks are not considered because the client quotes are rendered inside an inline element (here <i>...</i>), which ignores newlines and linebreaks. Changing https://github.com/Sommerregen/grav-theme-machine/blob/master/templates/modular/home_clients.html.twig#L14 to

    <p>{{ item.content }}</p>

    helps you out. If you like the italics, then apply the CSS rule font-style: italic; for .item-in p.

  2. I know why you can't change the title, because it is hardcoded (like many other strings) directly in the theme. I'm pretty sure, that one could do better, but a rewrite tooks a lot of time, I can't afford at the moment. But your question is easy to solve: just adjust https://github.com/Sommerregen/grav-theme-machine/blob/master/templates/modular/home_clients.html.twig#L6 and change it to

    <h4>{{ page.title }}</h4>

    Then, the title of the page https://github.com/Sommerregen/grav-theme-machine/blob/master/_demo/pages/01.home/_clients/home_clients.md should be respected.

  3. A new client must be placed here. Just copy one folder of the already existing ones and change the prefix, by increasing the number.
  4. I think mycode I posted above gives you a a good head start. Just follow the above instructions and you are good to go.
f1209 commented 8 years ago

Thank you. Thank you. Thank you.

I've got it mostly figured out and I'm fiddling with the CSS to fit my needs. I removed the quote box, and I've been able to theme things to my color palette.

I might have a couple more questions down the road, but for now, this gets me where I need to go.

Thank you. Again :)

Sommerregen commented 8 years ago

Great! If you have more questions, then please feel to ask. Should I leave this issue open here or can I close it now?

f1209 commented 8 years ago

I'll close it. I'll start a new thread if anything comes up. Thanks again :)