Tiddlywiki: Configure '$:/config/FileSystemPaths' to save to a folder based on a field - tiddlywiki5

I have a TiddlyWiki where the tiddlers have a field "saveto". I want to add a line to the file '$:/config/FileSystemPaths' to prefix the name of the tiddler with the value of the "saveto" field. For example, the tiddler
created: 20200114160408003
modified: 20200114160440095
saveto: test
tags:
title: New Tiddler
type: text/vnd.tiddlywiki
should be saved at test/New Tiddler.tid
Is it possible? I don't know much about filters, these are some things I have tried:
[has[saveto]addprefix[get[saveto]]]
[has[saveto]addprefix:get[saveto]]
[has[saveto]addprefix{!!saveto}]
Thanks for any help!

Here is something that works:
[has[saveto]get[saveto]] [get[title]] +[join[/]]
This solution was created by Jeremy Ruston as an answer to my post on the Tiddlywiki google groups forum

Related

Updating The name of already existing field to something else in NiFi

Is there a way I can update the name of existing field in the CSV file to a new name. I know we can use updaterecord processor. But can someone tell me what config to set?
Current i am using CSVreader and CSVSetWritter with Recordpath value and adding a new property:
Property Value
/oldname ${field.name:replace('oldname','newname')}
It is not changing the name of the field. Can anyone help me here? thank you!
Keep your csv reader controller service with old name and csv Writer controller service with new name for the field.
Then swap the data from old name -> new name
UpdateRecord configs:
As Replacement Value Strategy
Record Path Value
Add new property as
/newname value as
/oldname
For more details refer to this article as i have swapped the data from id field to rename_id field.

Can I use a Query String to drive personalized content in Sitecore 7.5?

I'm trying to display personalized content on a page IF I have clicked on a specific link on a specific page. My thought was to have a parameter on the link such as:
Go to product page
Then, on "Product Page", hopefully using the rules engine, check if the parameter home exists in the query string. If so, then display a piece of content.
I can't seem to figure out the best way to do this with Sitecore 7.5. Maybe this is the wrong approach.
Out of the box in Sitecore 7.5 there is no rule for using the querystring.
but you can easily create a rule and use with the personalize feature from Sitecore.
See http://blog.martinmiles.net/post/rules-engine-and-sitecore-personalization-based-on-url-query-string-parameters
for a complete description and Example include a link to github with the code
https://github.com/MartinMiles/Personalization
so you would have to have something like this:
public ActionResult Index(string name)
{
Student student = new Student();
student.Name = "John";
if (!String.IsNullOrEmpty(Request.QueryString["name"]))
{
student.Name = Request.QueryString["name"];
}
return View(student);
}
For this example, my controller is named Test. So if I want to call this method I would do ~/test/index, if I do that the student object will contain the name John, however if I do ~/test/index?name=Denis , I will send an object with the name Denis
Here the name will only change when we pass the query string "name" with a value.

Custom module in drupal 8, tab not created in admin section

I created custom module in Drupal 8. This module should create tab in admin/content. But unfortunately tab does not display in admin/content section. While I can able to access my module. Link to access my module 'localhost/demo/admin/content/book'
Here is my code:-
book.routing.yml
# book.routing.yml snippet
book.admin:
path: '/admin/content/book'
defaults:
_form: '\Drupal\book\Form\bookForm'
_title: 'BOOKS'
requirements:
_permission: 'book access'
book.links.menu.yml
# book.links.menu.yml snippet
book.admin:
route_name: book.admin
title: BOOKS
base_route: system.admin_content
For more information attaching screenshot, where I want tab
Expecting this one
you should rename the file to
book.links.task.yml
because what you want is a "task" of the content instead of a real menu link. Here's a great explanation and guide how to create custom modules:
http://www.sitepoint.com/build-drupal-8-module-routing-controllers-menu-links/
Note that some of his file namings are outdated (e.g. "menu_links"), but the general idea/structure of a module is still well explained.

Fake select field for Simple Form

I'm using Simple Form, and I have a few fields that are not associated with my model. I found using this fake field option to be a good solution:
https://github.com/plataformatec/simple_form/wiki/Create-a-fake-input-that-does-NOT-read-attributes
I thought this was cleaner than adding an attr_accessor value for my fields, and it works great for text input fields. I'm hoping to accomplish the same thing with a Select Field.
I found this thread, but I couldn't find anything else:
https://github.com/plataformatec/simple_form/issues/747
Has anyone found a similar option for a Fake Select Input? Thanks!
Assuming you'll use that "fake select" for UI purposes (probably as a mean to modify the form fields to present the user using Javascript?) and you don't want to deal with the value in the controller, you could just use select_tag with any field name, instead of the simple_form f.input. The value will be sent to the server, but it will be outside the model params, so you can just ignore it in the controller.
If I misunderstood your question, please clarify.
If your just trying to get the name='whatever' instead of having name='model[whatever]' I've found it easiest to just specify the name attribute in input_html { name: 'whatever', id: 'whatever' } hash which over rides the default model[attribute].
Otherwise you could create a fake_select_input.rb which would be similar to fake_input.rb but obviously use a select_tag instead and do something like as: :fake_select

How to create a unique constraints in YML in Doctrine2?

I Want to create a unique constraints on two attributs. The YML configuration with Doctrine2 isn't well documented. So I try to traduct the XML in YML. What's wrong with this code?
unique-constraints:
name: event_user
columns:
event_id: ~
user_id: ~
Thanks in advance.
Finally I managed to create it by this code:
uniqueConstraints:
event_user_idx:
columns: event_id,user_id
But Thank Reuven for your answer.
You should try that:
uniqueConstraints:
event_user:
columns:
- event_id
- user_id
I don't know if this part of the documentation has been added recently or not, but here is what it says:
# ECommerceProduct.orm.yml
ECommerceProduct:
type: entity
fields:
# definition of some fields
uniqueConstraints:
search_idx:
columns: [ name, email ]