sruupl / batflat

Lightweight, fast and easy CMS for free. Bootstrap ready. https://batflat.org
MIT License
135 stars 54 forks source link

Custom field as css class for posts #74

Closed lowpez closed 4 years ago

lowpez commented 4 years ago

Hello batflat Team! I would like to include a special css class for each post. Can I add / set up this type of feature as a text input field? If is a "yes" how? Thanks!

michu2k commented 4 years ago

Hi @lowpez Steps you need to do:

  1. Add a field to your view view/admin/form.html
  2. Add lang strings lang/admin
  3. Add field to DB Info.php (blog table)
  4. Add field to Admin.php. I think you only need to edit the getEdit function.
  5. Add your variable to YOUR_THEME/post.html and/or to YOUR_THEME/blog.html

There is nothing to do in Site.php, it should work without any modifications but I'm not 100% sure. There are only general steps that you need to know. If you know the basics of PHP, then you should handle this. All you need to do is:

w3bd3mon commented 4 years ago

Hello Michael,

I have reported a few bugs to you via my other email 3 days back from Vinit.patil2790@gmail.com. Request you to kindly revert on the same.

Thanks and Regards, Vinit Patil

On Sat, 9 May 2020, 00:43 Michał Strumpf, notifications@github.com wrote:

Hi @lowpez https://github.com/lowpez Steps you need to do:

  1. Add input to your view view/admin/form.html
  2. Add lang strings lang/admin
  3. Add field to DB Info.php (blog table)
  4. Add field to Admin.php. I think you only need to edit the getEdit function.
  5. Add your variable to YOUR_THEME/post.html and/or to YOUR_THEME/blog.html

There is nothing to do in Site.php, it should work without any modifications but I'm not 100% sure. There are only general steps that you need to know. If you know the basics of PHP, then you should handle this. All you need to do is:

  • Add view,
  • Add field to DB,
  • Add field to the appropriate functions in PHP

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sruupl/batflat/issues/74#issuecomment-625973107, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLVJTCLUVJHNLSUCFT74M3RQRKXJANCNFSM4MYG3C2A .

michu2k commented 4 years ago

Hi @w3bd3mon Sorry but I didn't receive an email from you. Can you send me an email again? michal.strumpf@gmail.com

Regards

lowpez commented 4 years ago

@michu2k , Thanks! With the suggested changes i got it. phpliteadmin was needed :P

New doubt, i'm trying to setup a tag for featured posts. So, my question is How can i check if the posts is tagged as featured or not in my blog page? Thanks!

michu2k commented 4 years ago

I am not sure if I understood but this code below will check if the post has the featured tag.

{loop: $value.tags as $tag}
    {if: $tag.slug == 'featured'}
        <span class="featured">{$tag.name}</span>
    {/if}
{/loop}

EDIT: You can even create your own function for this. Check https://github.com/sruupl/batflat/issues/27#issuecomment-415544915

w3bd3mon commented 4 years ago

Hello Michael,

I have sent an email on the official batflat email id's. Can you please let me know whether I should raise an issue via github or else which of the official email addresses.

On Sat, 9 May 2020, 00:45 Vinit Patil, w3bd3m0nsmfe@gmail.com wrote:

Hello Michael,

I have reported a few bugs to you via my other email 3 days back from Vinit.patil2790@gmail.com. Request you to kindly revert on the same.

Thanks and Regards, Vinit Patil

On Sat, 9 May 2020, 00:43 Michał Strumpf, notifications@github.com wrote:

Hi @lowpez https://github.com/lowpez Steps you need to do:

  1. Add input to your view view/admin/form.html
  2. Add lang strings lang/admin
  3. Add field to DB Info.php (blog table)
  4. Add field to Admin.php. I think you only need to edit the getEdit function.
  5. Add your variable to YOUR_THEME/post.html and/or to YOUR_THEME/blog.html

There is nothing to do in Site.php, it should work without any modifications but I'm not 100% sure. There are only general steps that you need to know. If you know the basics of PHP, then you should handle this. All you need to do is:

  • Add view,
  • Add field to DB,
  • Add field to the appropriate functions in PHP

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sruupl/batflat/issues/74#issuecomment-625973107, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLVJTCLUVJHNLSUCFT74M3RQRKXJANCNFSM4MYG3C2A .

michu2k commented 4 years ago

@w3bd3mon Ah, ok. I don't have access to the official Bf email address, so I can't reply to your email. @klocus can answer :)

lowpez commented 4 years ago

@michu2k , Thanks mate! 🤘🐶🎸