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

[WIP] Docs for Sage 9 #30

Merged
merged 22 commits into from Feb 7, 2018

Conversation

Projects
None yet
10 participants
@retlehs
Member

retlehs commented Apr 5, 2016

post-launch

  • rename 'theme wrapper' to 'blade templates', setup 301
Sage uses [Laravel's Blade](https://laravel.com/docs/5.5/blade) templating engine.

## Passing data to templates

Sage includes a `sage/template/{$class}/data` filter that can be used to pass data to templates. This is the most simple way to pass data.

```php
add_filter('sage/template/page/data', function (array $data) {
    $data['header_image'] = get_field('header_image');
    $data['header_content'] = get_field('header_content');
    return $data;
});

In your Blade templates for pages you can now use {{ $header_image }} and {{ $header_content }} to output the data.

Controller for Sage 9, written by Darren Jacoby, offers another method for passing data to templates. The Controller plugin works off of files in the app/controllers/ directory.

@retlehs retlehs self-assigned this Apr 5, 2016

@retlehs retlehs closed this Nov 27, 2016

@retlehs retlehs reopened this Nov 27, 2016

@retlehs retlehs changed the base branch from master to docs Nov 27, 2016

@Log1x

This comment has been minimized.

Show comment
Hide comment
@Log1x

Log1x Dec 30, 2016

Thought I'd throw it here rather than an issue (hope that's ok)--

https://github.com/roots/docs/blob/sage-9/sage/theme-development-and-building.md

To clear up confusion, when adding third party packages you omit the extension.

So import 'slick-carousel/slick/slick.min.js'; becomes import 'slick-carousel/slick/slick.min'; -- Just ran into this issue when beginning to convert my theme from Sage 8.5 to Sage 9.

Feel free to delete this post once acknowledged.

Log1x commented Dec 30, 2016

Thought I'd throw it here rather than an issue (hope that's ok)--

https://github.com/roots/docs/blob/sage-9/sage/theme-development-and-building.md

To clear up confusion, when adding third party packages you omit the extension.

So import 'slick-carousel/slick/slick.min.js'; becomes import 'slick-carousel/slick/slick.min'; -- Just ran into this issue when beginning to convert my theme from Sage 8.5 to Sage 9.

Feel free to delete this post once acknowledged.

smutek and others added some commits Jan 12, 2017

Update theme-development-and-building.md
Remove file extension from slick js import. (File extension causes 5:8  error  Unexpected use of file extension "js")
Update external js dependencies example to reflect the current file structure.
Update scss dependencies to reflect the current file structure
Merge pull request #67 from smutek/update-3rd-party-examples
Update theme-development-and-building.md doc
3rd party packages relative paths in production
Added reminder to change 3rd party packages relative paths. Without those paths `yarn run build:production` will fail since Webpack can't find the font files.
Text formatting
Deleted '!defaults' and formatted
Merge pull request #71 from jloproductions/sage-9
Sage 9 - 3rd party package's relative paths in production
Merge pull request #92 from cfxd/sage-9
Add front-end package manager history
updated theme structure
Changed Theme Structure from 8.5.1 to 9-beta3
Merge pull request #102 from dkcreatto/patch-1
updated theme structure chart
Update theme-installation.md
Version in sync with main README.md in terms of requirements. Installation command is more precise for the current situation (until 9.0.0 comes out).
Merge pull request #113 from Saboteur777/patch-1
Update theme-installation.md
Update theme-development-and-build.md
typo did you mean main.scss?
Merge pull request #121 from yeahsmaggy/patch-1
Update  theme-development-and-build.md

@retlehs retlehs merged commit ae133bf into docs Feb 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment