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

Create a block that lists the 3 most recent News nodes #13

Closed
mirie opened this issue Nov 12, 2014 · 1 comment
Closed

Create a block that lists the 3 most recent News nodes #13

mirie opened this issue Nov 12, 2014 · 1 comment

Comments

@mirie
Copy link
Contributor

mirie commented Nov 12, 2014

Issue

We need to have a recent news block to place on different pages. This will initially be used on the homepage (that task is tracked in a different issue).

Analysis

This Recent news component (NYC Camp Updates) is demonstrated in the prototype: http://nyc-camp.github.io/2015/style-guide/#/components?id=masthead

Mockup of Recent News block:

Basic Markup for block:

<div class="_masthead--feed--block masthead--feed--block">
  <h3>NYC Camp Updates</h3>
  <p class="feed--copy--first">Ex veri nostro instructior cum, doming utamur epicuri at vix. Mel brute integre accusamus in, fugit utamur vim no. <a href="#">Read more ></a></p>
  <p class="feed--copy">Ea purto summo usu. Tale dicat duo ei. Ex per liber impedit, usu te adhuc definitiones. Ne intellegam mediocritatem duo, ea quo inani semper laoreet. <a href="#">Read more ></a></p>
  <p class="feed--copy--last">Eos utinam deleniti doming utamur epicuri at vix. Et munere neglegentur vix, id sale brute graece nam. Nec in numquam appareat. <a href="#">Read more ></a></p>
</div>

Approach/Steps

  • The block should display the information form 3 News nodes, in reverse chronological order.
  • The title of the block = NYC Camp Updates
  • The classes and css is already setup in the theme
  • After the 3rd item, please additionally add a link
  • Current markup for this 3rd item is not ideal because <button> is nested inside of <a>.
<p>Interested in <strong>volunteering</strong> or finding out more?</p>
<a href="http://eepurl.com/QeepX"><button class="base--hollow--button">Subscribe to NYC Camp newsletter</button></a>

Note: if additional markup changes are needed (possible), please first update the component via a PR in https://github.com/NYC-Camp/style-prototype, or make the request with details via a github issue queue and assign to @rabellamy or @rkellertvd. At this early stage, we don't want our prototype to become obsolete.

You can choose to do either:

  • Create a view with a block display -- this view must be exported. You can either featurize this or just export the view.
  • Create a custom block using the block api.

Either solution is fine, however, please be mindful to set appropriate/reasonable caching.

If a module was created in #12, this would be a reasonable place to add this code. If not, please create a custom module with a reasonable name like: nyccamp_news or in nyccamp.module/nyccamp.block.inc

@timhobert
Copy link
Contributor

I created a custom News view and the News block in the header and also one for the main-suffix region, for now. I'm not doing a sidebar, yet. I would like to lay as much on the page, as it falls within the DOM, so that the content eventually informs the site design/theme.

You can see both news blocks on inner pages such as: http://dev-nyc-camp-2015.gotpantheon.com/nyc-camp/news/sample-news-post-number-three-three

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants