I'm using Blogdown to create a website and I'm using the 'Project' section for previous work experience. Is there any way to order each post in the the 'Project' section manually? As it is they are ordered alphabetically - however I would like to order them manually (based on reverse chronological order).
Thank you in advance!
If you want to arrange posts manually, try this: Add a weight in your YAML header. small weighted posts will appear first. For example, in post 1
---
title: I am a title
author: me
weight: 1
---
In post 2:
---
title: I am also a title
author: me
weight: 2
---
This works because that Hugo arranges the order of content regarding this default order: Weight > Date > LinkTitle > FilePath.
Buuut, how the ordering is implemented in each template may be different, in that case, you need to modify the template as well.
Source from the manual
Related
I am using Material UI Multiple Select based on documentation example. I need to save id of the selected option and show name,
I have tried many ways but nothing helps.
I need to store the id and Display the value. Please help me with your guidance.
Here is my codesandbox link
I was wondering about the same and the only way I found to make it work is by transforming the array to an object.
Here goes the sandbox: https://codesandbox.io/s/material-demo-5cy6p
In it you can see how names is no longer an array but an object with the value of the menu option as a key and the name you want to actual show as the value:
const names = {
1: 'Lorem',
2: 'Ipsum',
}
This way you can access the value(the name) in O(1) time (if you are not familiar with the Big O notation gives this a read: https://en.wikipedia.org/wiki/Big_O_notation), this is way faster than going through the whole array looking for an object with the same id as the one you are mapping.
How do I get the name of the pre test condition "Background" tag in a Feature using Specflow + Nunit in C #?
I can get the name of the "Feature" like this:
return FeatureContext.Current.FeatureInfo.Title;
And the name of the "Scenario" like this:
return ScenarioContext.Current.ScenarioInfo.Title;
I also need to get the name of the "Background", or check if it exists.
Feature: FeatureTest
Description Feature...
Background: Get Background name or check it exists (Return It)
...Given, And
Scenario: Scenario Test
...Given, And
TL;DR
The reason you can't access the Background, is because the steps contained within it are duplicated at runtime across all of the scenarios within a feature, effectively removing the background.
The Answer:
Generally speaking, Backgrounds do not have a title:
Ability: Adding and Removing items from the basket
As a customer,
I want the ability to add and remove items from my basket
In order to choose the items that I want to purchase from the site
Background:
Given I have logged in as a customer
And I visit the "Clothing" page
Scenario: Adding items to my basket
When I add "Black Jeans" to my basket in size "M"
Then the total should be "£9.99"
Scenario: Removing items from the basket
Given I have added an item of clothing to my basket
When I empty my basket
Then the total should be "£0.00"
The Background steps get duplicated across the scenarios within the feature, meaning that the scenarios in my example are effectively:
Scenario: Adding items to my basket
Given I have logged in as a customer
And I visit the "Clothing" page
When I add "Black Jeans" to my basket in size "M"
Then the total should be "£9.99"
Scenario: Removing items from the basket
Given I have logged in as a customer
And I visit the "Clothing" page
Given I have added an item of clothing to my basket
When I empty my basket
Then the total should be "£0.00"
Why would you need to access the Background description, if what you're actually testing is covered by the Scenario description?
That is why currently they do not offer this as a feature. It's additional information within a file that allow ease of reading and understanding of what is actually being tested - but if your steps are descriptive enough, do you need a description for the setup for a test?
This information is currently not available at runtime in SpecFlow. Please open an issue on GitHub for this, that we can potentially add this in later versions.
But generally it is bad practice to depend on such fragile (potential often changing magic strings).
Better way would be to check for a tag on Scenario or Feature level.
Also be aware, that you don't know at runtime, that you are currently executing parts of the background. There is no difference between these Given steps and the Given steps of your scenario.
I 've got a website based on Drupal that publish every Friday some news about different subjects related to my work (example : http://geotribu.net/GeoRDP/20150220). Right now we already do this but the process is bit painful. So I'm looking for a more straight forward and automatic way to do this.
It's a collaborative work and these news can be created by me or others users of my website. So I can't just create a single page.
I was thinking to create a content type called "news" that contains a single news. Then every Friday all the news created during the week are automatically published and visible on a single page .
Let's take an example and consider the following.
We have two users:
User1 writes news1
User2 writes news2 and news3
On Friday, all the news are merged into a single page :
http://mywebsite/weeklynews/...
news1
news2
news3
Do you have any idea how I could do that ? Or maybe a module exists that could help me ?
I have a 4 quicktabbed views blocks on a page and rightnow. All blocks show lists that can be sorted by "Title" with an exposed filter and a sort order dropdown button for options "A-Z" and "Z-A". So the user can view the list either way. I need to add another exposed filter option for posted date. I see how to do that and it's now an option in the pulldown button that shows "Title" but I can't see how to add option for "most recent" and "oldest" either in the sort order dropdown button or anywhere. Can this be done in the views UI or is this going to involve some php coding? If php, where do I start, given I'm a php newbie?
I don't know if you've figured it out yet, I had to do something similar recently.
this answer helped me [Drupal 7: Exposed filter on a post date just to set up a created date filter.
As for the newest/oldest sort, you add Content: Post date to your Sort criteria, the you could maybe check the Advanced sort options in BEF Settings for your view. There you can combine 'sort order with sort by' like the following current_value|replacement_value pair:
Publication date Asc|Oldest
Publication date Desc|Newest
Let me know if that was helpful in any way or if you need a more detailed answer
I've searched for days and not found a clear answer for this.
I'd say I'm intermediate with Drupal (at best). I'm using Views, Panels, CCK, and the Date modules (among others, that may not relate to this question)
I've got a content type of Shows (plays), that has a date range field (from the date module) that is the run date of the show.
I've got 3 views blocks that I filter using the Content: Show Dates - start date and Content: Show Dates - end date fields. These display a list (links) to shows that are of 3 categories, now playing, upcoming, and past shows. They work fine.
Now for the tricky part (for me). I want Panels (Node rewrite for Shows) to decide which one to display in the sidebar while looking at a Content:Show based on whether it is currently running, yet to run, or in the past.
What are the steps to make this happen?
thanks!
jason
Edit: I'm working with Blocks too.
I would suggest to create 3 views (not necessary blocks if you have enabled the "Views content pane" module), one for each date option with a nid as Contextual filter and a display of Content:Node. Then add all the 3 views in one panel page variant one after another. Probably you already have these blocks. So you can clone them and just add a nid Contextual filter.
Another option is to create 3 different variants for the same node type and add a Selection Rule for the Show Date field (Selection Rules screencast). If there are no filters for the date field add some php code. Here is an example.