Jump to content

RockFrontend 🚀🚀 The Powerful Toolbox for ProcessWire Frontend Development


bernhard

Recommended Posts

I can't remember for sure but I don't think so. I think it has always been injected automatically (as it was meant to be zero-setup from the very beginning) and I wanted to avoid having instructions in my readme that are necessary to make everything work.

Is your problem fixed now?

  • Like 1
Link to comment
Share on other sites

2 hours ago, bernhard said:

Is your problem fixed now?

Yes thanks. I think those elements must have dated from the early days of RockFrontend and I never updated that _main.php. So I've re-done it all now as per the latest readme and it all seems fine.

  • Like 1
Link to comment
Share on other sites

6 hours ago, gornycreative said:

I'm sure the answer is yes, but... This replaces RockLESS functionality, correct? RockLESS can be replaced/removed since the styles array and vars covers the same ground?

Yes and no. I think the answer to what you mean is yes, but to be precise: The LESS module (https://github.com/ryancramerdesign/Less) got some updates some time ago that make RockLESS obsolete. I'll update RockLESS readme, thx!

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Happy new year 😉 

and another rockfrontend question 😄 

I saw this information in the Latte documentation: https://latte.nette.org/en/develop#toc-debugging-and-tracy

Is there an easy way to use this with the Tracy debugger and RockFrontend module?
is it possible to add it here? https://github.com/baumrock/RockFrontend/blob/c7ac651f198f6470710b814ec50530b71dcfafb2/RockFrontend.module.php#L1443


When the templates get a bit bigger and more nested, that's definitely interesting 😉 

Link to comment
Share on other sites

Hi @zoeck thx and same to you! It would have been nice to create a new topic for that question. It's easier for everybody to keep track of it and this thread is already 7 pages long... 😄 

To your question: I don't know. I've also seen that screenshot and thought it would be great to have, but I don't know if or how that would work. If you find it out I'm happy to add it to the module 🙂 

  • Like 1
Link to comment
Share on other sites

54 minutes ago, bernhard said:

If you find it out I'm happy to add it to the module 🙂

Okay then I'll have a look at it, I hope it's not that difficult to implement 😉 

  • Thanks 1
Link to comment
Share on other sites

Hi  @bernhard,

I'm not 100% sure if it's correct to assign it to RockFrontend – today I found a strange one: I'm using a field FieldtypeOptions v0.0.2 with value and title as entries. It's config is radios = only single value. I'm used to call it as noted in the api example:

// Ausgabe einer einzelnen Auswahl:
echo '<h2>' . $page->test_options->title . '</h2>';

// Ausgabe mehrerer Auswahlen:
foreach($page->test_options as $item) {
  echo '<li>' . $item->title . '</li>';
}

Actually it's output is different in context with RockFrontend and its renderLayout() function. One has to use the ->first() call to get the title, otherwise the page-title gets rendered instead. This is the case in any template file, if it's a section.latte or main.php … same thing - please see attached screenshot.

Any ideas what's going on? It's not a big thing, but it took me some time to figure it out and maybe worth fixing it with regard to compatibility.

The field settings:

'test_options' => [
  'label' => 'test-options',
  'flags' => 0,
  'type' => 'FieldtypeOptions',
  'inputfieldClass' => 'InputfieldRadios',
  'optionsLang' => [
    'default' => [
      1 => 'a|ONE',
      2 => 'b|TWO',
      3 => 'c|THREE',
    ],
  ],
]

2023-01-12_18-28-41.pdf

  • Like 1
Link to comment
Share on other sites

Hi, that's an interesting one. Could you also check the value in different locations please. Eg in site/ready.php or in _main.php before anything else? Maybe that tells us something. Because I have no idea until now.. 

Link to comment
Share on other sites

Hi @bernhard, thank you for replying…

echo $page->test_options->title…

  •  in ready.php works as expected
  •  in _main.php it gets replaced by page title field, same in main render file latteRenderer.php or any section.latte template file
  • a bd($page->test_options) looks good
  • a bd($page->test_options->title) shows the page title instead
  • a tracy console call echoes correct $page->test_options->title

select-options.jpg

  • Like 1
Link to comment
Share on other sites

Thank you @bernhard!

I can reproduce this behaviour in three of my instances (all are using your awesome modules) – but they all share some boilerplate code of mine… so I won't exclude some mistake on my side.
One fresh install with no custom additions nor using rf or rm has no issues so far. To my excuse, I do the first steps with your modules and custom PageClasses and latte … for me a lot of new stuff to learn – so no stone is left unturned… and maybe i messed up something.

I'll keep a look at it and report back here, if I find anything causing this… hopefully not too embarrassing at the end  🤭.

 

  • Like 1
Link to comment
Share on other sites

17 minutes ago, sz-ligatur said:

I can reproduce this behaviour in three of my instances (all are using your awesome modules)

First of all thx for that and I'm happy to hear that 🙂 

20 minutes ago, sz-ligatur said:

One fresh install with no custom additions nor using rf or rm has no issues so far.

It would be interesting to add things step by step and see when things start going wrong! Maybe you can share a test project so I can have a look. But I'd appreciate if you can find it yourself of course 😄😉

Link to comment
Share on other sites

  • 2 weeks later...

Aaaah! I have a fixed navbar in my project which acts as an overlay. So your topbar was hidden underneath it.

image.png.7ad42554ee3e08016d961eec9ef550c7.png

My only advise would be to increase the z-index of the topbar to a really high value to make sure it will be visible in most of the cases.

I love the mobile toggle option. It would be nice to be able to chose between tablet and phone size.

 

Link to comment
Share on other sites

13 minutes ago, Stefanowitsch said:

My only advise would be to increase the z-index of the topbar to a really high value to make sure it will be visible in most of the cases.

Or configurable as in the Tracy Bar 🙂 

  • Like 2
Link to comment
Share on other sites

Thx to feedback and a good find from @Stefanowitsch v2.18.0 also copies .css.map files over to the assets folder, which is helpful if you are using one of the postCSS features like rfGrow() or rfShrink()

You are not using them yet? You are missing something! They are so great 🥰 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

v2.19.0 comes with a new handy javascript snippet that can help, for example, to create to-top-links that slide in after a certain scroll position:

5vdy0Xt.png

Quote

Add/remove class on scroll position


Usage:
<a href='#' rf-scrollclass='show@300'>Add class "show" at 300px scrollposition</a>

If you have ideas for improvement let me know!

  • Like 1
Link to comment
Share on other sites

I don't understand, it says on the doc that all variables defined in _init.php should be available in the latte files.
But I always get "undefined variable" ...  it's the same result if the latte file is called with render or renderLayout
I don't know what I missed 😕 

Link to comment
Share on other sites

  • bernhard changed the title to RockFrontend 🚀🚀 The Powerful Toolbox for ProcessWire Frontend Development

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...