I want a 'Text Field' in a folder that is within a document library - Sharepoint 2010 - sharepoint-2010

I am rather new to sharepoint and have been lucky enough to find the answer to all my questions with research. I have no found the answer to this question yet.... How do I add a text field WITHIN a folder that is WITHIN a document library. Example: I want to put instructions for upload within a specific folder. I tried to to the 'edit page' --> add text, but the text shows up at the top of ALL folders within that library and I just want it in one. Thank you for your assistance!
Kind regards,
Lanie

You can manage visibility of your message using JavaScript as below.
Don't directly add your message in text field; instead click of the text field you have added, and click "Edit HTML Source" in ribbon bar as highlighted in below image.
Then paste below code in newly opened window:
(Don't forget to replace "Your Message" and "FolderNameInWhichMessageToBeShown" in below code)
<div id="MyCustomMessage">
Your Message
</div>
<script type="text/javascript">
if(decodeURIComponent(document.URL).indexOf('FolderNameInWhichMessageToBeShown') == -1)
{
document.getElementById('MyCustomMessage').style.display = 'none'
}
else
{
document.getElementById('MyCustomMessage').style.display = 'block'
}
</script>
Click "OK" and Save your page.

Related

Bigcommerce Add To Cart Pop-Up

When using bigcommerce before, we were able to choose whether or not to have a pop up or take the user to the cart whenever they clicked the "Add to Cart" button. Does anybody know if this feature has been taken out by BigCommerce or where I can find that setting now? Thank you!
Do you know if you're using the Stencil or Blueprint framework?
If you're using blueprint, you can go to "Store Setup > Store Settings > Display" and choose "Take Them to Their Shopping Cart".
If you're using stencil, that feature is hidden and you have to do customization for it to work. If your products don't have any options, you can follow the instructions on this page: https://support.bigcommerce.com/articles/Public/How-can-I-add-a-product-to-the-cart-with-a-link/#add-to-cart.
However, if you have options, this won't work because it doesn't updated the sku in the url. What i did to get this to work was to edit the product-details.js
First you need to download the theme in order to edit the js file. Then, starting on line 234, you'll see the following code:
// Open preview modal and update content
if (this.previewModal) {
this.previewModal.open();
this.updateCartContent(this.previewModal, response.data.cart_item.hash);
} else {
this.$overlay.show();
// if no modal, redirect to the cart page
this.redirectTo(response.data.cart_item.cart_url || this.context.urls.cart);
}
Directly under the comment, add /* and then go down one line under the closing brace of the else statement (}) and add */ to close the long comment. The code will now look like this:
// Open preview modal and update content
/*
if (this.previewModal) {
this.previewModal.open();
this.updateCartContent(this.previewModal, response.data.cart_item.hash);
} else {
this.$overlay.show();
// if no modal, redirect to the cart page
this.redirectTo(response.data.cart_item.cart_url || this.context.urls.cart);
}
*/
this.redirectTo(response.data.cart_item.cart_url || this.context.urls.cart);
Let me know if this helps!
Just FYI I went through a similar problem and found that the "Ask a Design partner" forum gave me my answer. The answer I used was from this post:
https://support.bigcommerce.com/s/group/0F913000000HLpWCAW/ask-a-design-partner
But to help I will pull out what they said:
"If you want to remove the popup, you will need to edit the theme files, navigate to the templates/components/products/product-view.html file, and comment out (or remove )this code at the bottom of the file:
<div id="previewModal" class="modal modal--large" data-reveal>
<a href="#" class="modal-close" aria-label="{{lang 'common.close'}}" role="button">
<span aria-hidden="true">×</span>
</a>
<div class="modal-content"></div>
<div class="loadingOverlay"></div>
</div>
Hi You need to do this :
1. Login to admin-end then go to store setting
2. From top tabs choose display tab
3. Find the 'Add to Cart' Action choose what you want pop window or redirection to the cart page.
4. hit the save button.
Check image:
Thanks

IFRAME with HTA prompt with VB

I have an HTA prompt with VB code. I would like a URL loaded within the HTA window when the "SUBMIT" button is clicked. However, I cannot find any information that is helpful for my situation. Can someone please help me include an iframe in my HTA prompt so that a website can be displayed? I can use https://www.google.com as an example. Let me know if you have any questions.
Here is the code I currently have for the submit button:
bodystring = bodystring & "<BR><BR><BUTTON CLASS='Bttn_Back' OnClick='PrevStage()'>BACK</BUTTON> <BUTTON CLASS='Bttn_Submit' OnClick='NextStage()'>SUBMIT SURVEY</BUTTON>"
Here is my section of code for the "NextStage()" function:
ElseIf STAGE = 62 Then
SaveResults()
Window.Close()
End If
Put this to the HTML of the HTA:
<iframe id="htmlhere" src="" style="display: none;"></iframe>
Then in nextStage():
document.getElementById("htmlhere").src = "http:/..."; // Loads a new document to iframe
document.getElementById("htmlhere").style.display = ""; // Setting style.display empty shows the iframe
Sorry for using JS, but my VB skills are more or less zero.

Colorbox: pop-up image with link to external site on click

I hope someone can help me. I have colorbox working on a new client site, but I'm having troubles figuring out how to add code that will allow for the image that pops up to be clicked and then linked to an external site in a new tab.
This is what I have so far:
$(document).ready(function(){
$("a[rel='pop']").colorbox({transition:"fade", speed: 250});
});
<span class="h2">Baby Knits Kit</span> (2007)<br>Chronicle Books<br>
In the above, when Baby Knits Kit is clicked a pop-up opens fine with the image I created (about.babyknitskit.png). On top of the pop-up there's "Get it at Chronicle Books" and when I click it will take me to that site (in the same tab which I don't want). Instead, I would like the about.babyknitskit.png image to be clickable and opening up the link in a new window.
Any thoughts much appreciated. I hope I've given you guys enough information as I'm new to all of this and stackoverflow.
Simply use the html property of colorbox. Alternatively you could use the href property with 'inline' set to true. I have defined a custom attribute for the anchor for easier extraction, alternatively you could write a regex pattern to extract it from the title attribute.
$(document).ready(function() {
$("a[rel='pop']").colorbox({transition:"fade", speed: 250, html: function(){
var html = $('<img src="' + $(this).attr('href') + '" />');
return html;
}});
});
<span class="h2">Baby Knits Kit</span> (2007)<br>Chronicle Books<br>

google translator highlight effect

I looked all over for a code that will that would highlight a piece of text when I hover (or click) another text.
For instance if I have the text 'Je suis ici. I am here', when i hover the word 'here' I will have a yellow bachground for the word 'here' and for the word 'ici'. So I can show that the word here is the english corespondent for the french word 'ici'.
Something like google translator uses: http://translate.google.com/
Thanks in advance for any suggestions!
Dana.
The way that Google Translate does it, is to split up each word in a sentence into separate <span> tags with matching classes. These are then accessible via the DOM in JavaScript - most easily by using a framework such as JQuery.
For example, you could attach a mouseover() function to highlight the currently hovered word.
I can't give you a full example here - you'll need to come up with a starting point and develop your solution from there.
This uses the jquery library and is borrowed heavily from this answer on SO to a related question.
What it does is break up each word in a paragraph tag (<p>) and wrap it with a <span> tag with a class of highlightable and then attach an event on hover to the <span class='highlightable'> tags. If you want only one paragraph to be used, then give it an ID and bind only to those items in that given ID. If a few paragraphs, use a class or multiple IDs.
<p>Each word will be wrapped in a span.</p>
<p>A second paragraph here.</p>
<script type="text/javascript">
$(document).ready(function() {
// wrap words in spans
$("p").each(function() {
$(this).text().
replace(/\b(\w+)\b/g, "<span class='highlightable'>$1</span>");
});
// bind to each highlightable span
$('.highlightable').hover(
function() { $(this).css('background-color','#ffff66'); },
function() { $(this).css('background-color',''); }
);
});
</script>

how can I add event to richfaces fileUpload "on clear"

there are clear, clear all buttons on richfaces fileUpload component.
<rich:fileUpload id="quoteFile" tabindex="10" listHeight="80" maxFilesQuantity="1" onuploadcanceled=""
clearControlLabel=""
clearAllControlLabel=""
acceptedTypes="xml"
fileUploadListener="#{loadSaveQuotes.uploadListener}">
<a4j:support event="onuploadcanceled" action="#{loadSaveQuotes.clearUploadData}" reRender="footer" />
</rich:fileUpload>
all I want to are:
1, remove the both buttons so that end user cannot click it. as I set clearControlLabel to "", and clearAllControlLabel to "", but only clearControlLabel is hidden. still have clear All Control appear as [x] button and I still click it
2, if I cannot remove these button, so how do I take control of them. like add an event listener to that on clear event. I added an a4j:support event but it do not trigger when I click clear button.
many thanks for your contribute.
Add an a4j:support for 'onclear' JavaScript event. The code is self-explanatory:
<rich:fileUpload id="upload">
<a4j:support event="onclear" reRender="upload"/>
</rich:fileUpload>
You can hide these buttons through CSS, e.g. you can give your fileupload an additional class like
<rich:fileUpload styleClass="my-upload"> etc. </rich:fileUpload>
and then use CSS Specificity to overrule the appearance of this fileupload component:
.my-upload .rf-fu-btns-rgh, .my-upload .rf-fu-itm-rgh {
display: none;
}
You can choose any combination of selectors that has higher specificity then the original one from RichFaces. I find having an extra class the cleanest solution, as it would allow me to have "normal" and "modified" RichFaces components next to each other, only differing in their style class.
You can look up the RichFaces style classes of the elements you want to alter in the RichFaces component documentation or with your favourite website inspection tool.
I was having the same requirement. Hide Clear All button and Clear Link but only when the file is submitted for upload. I solved this requirement with dynamic css through JavaScript. Below is the example.
rich:fileUpload control
<rich:fileUpload id="excelUploader"
fileUploadListener="#{uploadUIController.excelFileUploadListener}"
acceptedTypes=".xls"
maxFilesQuantity="1"
noDuplicate="true"
ontyperejected="Wrong file type selected !"
serverErrorLabel="Invalid file type selected !"
listHeight="100px"
doneLabel="Excel Upload Completed !"
onfilesubmit="showHideClearLink()"
styleClass="fileUploadClass"/>
Javascript code at the top of the file...
<script type="text/javascript">
function showHideClearLink()
{
var styleSheet = document.createElement('style')
styleSheet.innerHTML = ".fileUploadClass .rf-fu-btns-rgh, .fileUploadClass .rf-fu-itm-rgh {display: none;}";
document.body.appendChild(styleSheet);
}