How can I change the placeholder of global search field in Laravel Nova - laravel-nova

I want to change the placeholder of global search field in Laravel Nova from "Press / to search" to another text

Open the JSON file located
ROOT_PROJECT/resources/lang/vendor/nova/YOUR_LANGUAGE.json // default en.json
and edit in this way
{
// ... other strings
"Press / to search": "YOUR CUSTOM PLACEHOLDER"
}

Related

Enter press event for vaadin 10 TextField

Is there any specific way to add shortcut Listener for the Enter Key on a specific TextField element in Vaadin Flow. The documentation is silent about this.
I guess you are not actually looking for a ”shortcut” key but to react to enter presses when the focus is inside the field? If so, see KeyNotifier and e.g. addKeyPressListener.
It is also possible to listen to any DOM event using the element API, e.g.
textField.getElement().addEventListener("keyup", e -> {
System.out.println("Value is now: " +
e.getEventData().getString("element.value"));
}).addEventData("element.value").setFilter("event.keyCode == 13");
In the Vaadin Directory there is a UI Web Component for Vaadin 10. It's called shortcut. The usage is very simple:
Shortcut.add(messageField, Key.ENTER, sendButton::click);
You also can also add modifier keys like that:
Shortcut.add(messageField, Key.ENTER, sendButton::click, Key.SHIFT);

typo3 tsconfig url parameters media

We are using Typo3 7.6.
We use a simple text and media Element to embed youtube videos.
Those youtube video-embed links do need paramters (like rel=0), but I see no option to imput them and I do not find any typoScript where I can set those parameters in any help. Putting the paramters directly into the URL that I enter in the element does not work, merely the ID is parsed.
Is there a simple way to do this?
You need to set buttons.link.queryParametersSelector.enabled to true in your page TS-Config.
To do this edit your rootpage(normally id=1) and go to tab Resources.
Fill in the following code to the field Page TSConfig.
RTE.default.buttons.link.queryParametersSelector.enabled = 1
After saving you should see an additional field called "Additional link parameters" when you use the link wizard.
Reference: EXT: rtehtmlarea -> buttons.link.queryParametersSelector.enabled
I assume you use fluid styled content? If so, the gallery processer could be configured via TypoScript setup like this:
lib.contentElement.settings {
media {
additionalConfig {
no-cookie = 1
modestbranding = 1
relatedVideos = 0
showinfo = 0
}
}
}

Sitecore MVC and FieldRenderer.Render for Links

I'm trying to render a general link field like this - FieldRenderer.Render(item, "link").
This works as expected but how do I set custom text within the a tag that gets rendered. I want my output to look something like this
[custom text from another field]
Basically, the text for the link should come from another field on the item.
Thanks
Jason has a great idea, but this functionality is out of the box.
#Html.Sitecore().BeginField("Link Field", new { haschildren= true })
#Html.Sitecore().Field("Text Field")
#Html.Sitecore().EndField()
No need to modify anything at all.
You probably want to try the following:
#Html.Sitecore().BeginField("Link Field")
//custom code
#Html.Sitecore().EndField()
Varun's answer is definitely correct, however you will encounter an issue when the content editor has put a value into the Description field of a General Link. The link renderer will output both the description and whatever is between the BeginField and EndField methods.
A solution would be to allow for an extra parameter (HideDescription) which can hide the description. Two possible solutions for this would be;
Override the standard Sitecore.Xml.Xsl.LinkRenderer class with your own that would stop the description from being put in.
Add a custom pipeline step after the Sitecore.Pipelines.RenderField.GetLinkFieldValue which will do some post rendered processing to remove the description.
Option 2 is less invasive but is a little more difficult to make sure the results are 100%. Once you have this you can then render fields like the following;
#Html.Sitecore().BeginField("Link Field", new { HideDescription = true })
#Html.Sitecore().Field("Text Field")
#Html.Sitecore().EndField()
already has been answered but this worked for me
#Html.Sitecore().BeginField("Target URL", item.InnerItem, new { text = #Html.Sitecore().Field("Title", item.InnerItem) })
#Html.Sitecore().EndField()
You can also use begin and end-field and use the haschildren property, this will hide the text and just display any child-content between the begin and end statements:
#Html.Sitecore().BeginField("ItemName/ID", Model.DataSourceItem, new {
haschildren = true,
#class = "my-custom-class"
})
<span class="extra-content">
#Html.Sitecore().Field("Text Field")
</span>
#Html.Sitecore().EndField()

HTA: Predefined message in textarea on click?

I'm trying to build an HTA app with a textarea box with pre-defined text:
<textarea name="Box1" rows=3 cols=75>Use this area for inputs that require multiple lines of text.
This is an example of pre-defined text.</textarea>
Which works. However, I'm also adding a reset button that clears some of the input boxes and textareas:
Sub ResetSub
Value5.Focus
Value5.Value = "Reset successful"
Box1.Value = "Use this area for inputs that require multiple lines of text.
This is an example of pre-defined text."
End Sub
<input id=runbutton type="button" value="Reset" onClick="ResetSub">
Loading the HTA I get an "Unterminated string constant" error because Box1.Value doesn't have quotes at the end of the line. Does anyone know how I can fix this? NOTE: I can't reload the entire page because I also need to retain data from other text boxes. Thanks for the tips!
You can include a newline like so:
Box1.Value = "Use this area for inputs that require multiple lines of text." & chr(13) & "This is an example of pre-defined text."

Upload a textfile using script in Google spreadsheets and write the contents of the textfile into a sheet in the spreadsheet

Using a custom function that is called by clicking a button on Google Spreadsheets, I want to upload a text file into a specific folder and then put the contents into a specific sheet of the spreadsheet?
I know how to create a button and call a custom function on clicking it. Now through my custom function I want to:
Ask the user to browse to the text file location, and then select the file and upload it.
Upload it to a specific location and also change the file name to a specific name I want.
Read the contents of the text file and put them into a sheet in the spreadsheet.
Thanks!
Creating a button, and assigning a macro (function) to that button, or you could just as easily create a new menu item in your Google spreadsheet. The new menu item would be achieved programmatically using a custom function, and executed using the onOpen trigger for your spreadsheet.
function onOpen(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [ {name: "Text File Upload", functionName: "text_file_upload"},
{name: "Change Name", functionName: "change_name"},
{name: "TextFile to S.sheet", functionName: "t_file_ssheet"} ];
ss.addMenu("Text Files", menuEntries);
} //this onOpen function will add a new menu to your spreadsheet called "Text Files" with 3 submenu items you can use to work with your text files.
function text_file_upload() {
Browser.msgBox("You are about to upload new text file");
//insert code here to get textfile location/Url and Textfile Data, this can be stored in array
}
function change_name() {
var newName = Browser.inputBox("Enter the new name for the text file:");
//insert code here to assign new file name to the text file
}
function t_file_ssheet(){
//insert code here to copy data from your textfile to a sheet in your spreadsheet
}
There is a very nice tutorial here Tutorial: Interacting With Your Docs List that covers most of the coding your looking for.

Resources