Quantcast
Channel: ActiveTopics
Viewing all 72689 articles
Browse latest View live

Global Variables in Razor View Engine

$
0
0

is there a way for me to use a functionality similar to what are called Global Variables in the Spark View Engine, but for Razor.

The point of it all lis to be able to define a variable in one section for the title and then being able to set or change the value of that variable later on in another section.

In Spark you would create the variable in a section kind of like this (incomplete code for example purposes):

    <html>
  <head>
    <global type='string' Title='"Site Name"'/>
    <title>${Title}</title>
  </head>
  <body>
    <div><use content="view"/></div>
  </body>
</html>

And then you could set it in a different view or section or whatever:

<set Title='product.Name + " - " + Title'/>

How would I go about doing something like this in Razor or just solving a similar problem if I have the wrong approach ?


Learning Umbraco.!!

$
0
0

There does not seem to be too many tutorials on the web to learn Umbraco. Does anyone know of any great resources? Thanks

Extending backoffice Member Types

$
0
0

Is there a way to override backoffice membership provider.

i want to update Username, Email and other custum properties in external applications. I can override PerformCreateUser from MembersMembershipProvider but i'm not sure how to get custom properties of my Member Type.

Any suggestions?

Is it possible to add my own submit button and action for that? enter image description here

SEOChecker.config is reset on every git push from other environments using Umbraco Cloud

$
0
0

Hi Richard and others, I mailed you about this, but didn't see any changes regarding this in v2.1, so I thought I'd create it here too. Not sure if a bug or feature request too.

The issue is, that the customer makes changes in the SEOChecker section that is saved in the SEOChecker.config file. When we deploy new code through git, this file is reset to the version in the source control, so all the changes the customer did is lost. Same happens if you touch a document type or template on the live site, which also triggers a git commit.

Steps to reproduce:

  1. Make a change in the SEOChecker section that is saved in SEOChecker.config
  2. On your local environment, make a change to a random file that triggers a change in git
  3. Commit the changed file and push it to the live site
  4. Notice that your change in SEOChecker.config is gone

Only solution right now is to do all seo changes on localhost, and commit them through git. But domain settings are environment specific on Umbraco Cloud, so we can't make all the necessary changes on localhost.

Umbraco Cloud automatically keeps git in sync with changes to document types, data types, dictionary items and templates when they are changes from the live environment. Maybe it's possible to achieve the same with this file?

We can't be the only one experiencing this, do anyone else have suggestions on what to do?

Thanks :)

Image deleted in media tied to content

$
0
0

Hello community

How to avoid the problem that deletes an image that is tied to a content and is a mandatory field of the document type is eliminated and in the content the image is as trashed.

As valid that the image always exists and is not as deleted.

Thanks

TinyMCE Plugin insertion for Umbraco 8

$
0
0

How to insert plugin to umbraco v8 tinyMCE ? configuration seem to be diferent from v7 . documentation have not updated for v8.

TinyMCE In Umbraco 8

V8 : DefaultAnalyzer on custom index

$
0
0

Hi, I have created a custom index and I am trying to use a custom Lucene Analyzer. My custom analyzer is displayed in the back office (CustomAnalyzer) on screenshot but the code in it is never fired.

Does anyone has been successfull doing this kind of thing ?

Thank youenter image description here


Managing relations in the back office

$
0
0

I don't see a way of assigning relations in the back office - like you could in Umbraco 7.

I see in Umbraco 8 that I can create a new Relation Type - but I have found no way in the Back Office for me to configure it further.

I can only see in the documentation mention of doing things programmatically.

Would anyone be kind enough to educate me further on this subject?

Thanks!

Possible to default the payment and shipping methods?

$
0
0

We want to get rid of the page where we ask for payment method and shipping since we only give one option anyway, is there a way to set these as default so you can just GeneratePaymentForm without them?

ContentByXPath fails after Umbraco 8 migration

$
0
0

Hi Umbracians!

Hoping somebody else has come across the same issue.

I am in the process of migrating a site from U7 to U8; as part of this, I have downloaded the "experimental" version of the migrations from here:

https://github.com/umbraco/Umbraco-CMS/pull/6002

And imported the database as per the guide (and then pointed my Umbraco 8.5.3 project at it).

This seems to have worked - the data is in the format I expect and most of it loads fine, having rewritten the templates etc. to work with Umbraco 8.

So far so good....

However, there are some macros which use the ContentAtXPath method to return groups of the same document type - e.g. for the site news, it tries to retrieve most recent news items. The code for that looks like this:

var xpath = "//newsItem [@isDoc]";
var newsItemsXpath = Umbraco.ContentAtXPath(xpath);

Looking at the "newsItemsXpath" variable after this code runs, there is an error when trying to evaluate the enumerator, which is:

ArgumentException: Could not cast or convert from System.Int64 to System.String[].

Message: "Error converting value 458 to type 'System.String[]'. Path '', line 1, position 3." string

This seems to be related to the issue described in the GitHub issue above, except that my understanding here is that ContentAtXpath will retrieve the data from the XML cache.

The News pages themselves seem to load without an issue, so I'm a bit stumped - I can't find where this data is in Umbraco 8.

Has anybody else experienced anything like this in V8 using ContentAtXPath?

(Also - is Xpath still the best way to do this? I could use Linq to get the items, which seems to work, but I'd be concerned about performance as this macro is used in quite a few places).

Language ezSearch

$
0
0

Hi guys How can I change the language in ezsearch

enter image description here

All variant Data not showing? Backoffice and on Front end

$
0
0

So the site was showing all the Variant data fine in the back office this morning.

Then this afternoon, the Variants tab won't show any variants? On the front end of the site, there are no variants in the drop-downs either.

I see this on the back end though when I open the Variants tab.

enter image description here

Variants not being populated:

enter image description here

Pick a file for download

$
0
0

hi everyone

I try to implement a custom workflow for UmbracoForms. After a user fills out the form, he should get a E-Mail with a Link to download a specific file.

I tried to add a property with the view "File" for the workflow settings, but when i want to submit my media selection i got a error, because umbracoFileProp is undefined.


UmbracoForms Code:

function populateFile(item) {

        //From the picked media item - get the 'umbracoFile' property
        //Previously we was assuming the first property was umbracoFile but if user adds custom propeties then it may not be the first
        //Rather than a for loop, use underscore.js
        var umbracoFileProp = _.findWhere(item.properties, {alias: "umbracoFile"});

        if(typeof umbracoFileProp.value === 'object'){
            $scope.setting.value = umbracoFileProp.value.src;
        }else{
            $scope.setting.value = umbracoFileProp.value;
        }


    }

in the parameter item I see the selected File, but item.properties is already undefined.

Does anyone know a solution for this? I use Umbraco 7.15.3 and UmbracoForms 7.2

Thank you

Yannick

Using Content Service to delete specific versions

$
0
0

The Umbraco ContentService has a method to get all previous versions of a specified piece of content eg.

var versions = Services.ContentService.GetVersions(1234);

would return all the previous versions for a piece of content as IEnumerable<IContent>

So far, so good.

There is also a ContentService method called DeleteVersion(int Id, int versionId) which you pass the ID of the content and the versionID to delete. But where do you get his version ID from?

The IEnumerable<IContent> returned by GetVersions() all have the exact same ID. Example:

var versions = Services.ContentService.GetVersions(1234);

foreach (var v in versions)
 {
            <p>@v.Name - @v.Id | @v.PublishedVersionId</p>
}

For an example page it would return:

Example Article - 1149 | 130

Example Article - 1149 | 130

Example Article - 1149 | 130

Example Article - 1149 | 130

Each one is the same and has the same ID, published version ID etc. same create date etc. So how do you distinguish between them to target a specific version? My ultimate goal is to delete all versions except the most recent.


Rebuild index programmatically in Umbraco 8?

$
0
0

Is there a way to rebuild an index programatically in umbraco 8? Can't find anything in the docs.

There appears to be a way to re-index a specific node but I want to rebuild the entire index.

any ideas?

Mandatory field not updated in content node.

$
0
0

I switched a field from mandatory to not mandatory in my document type but am getting a validation error in the content section:

Validation: Item 1 'x' Item 1: 'y' cannot be empty

I'm running Umbraco 8.6.0-rc. The field is in a nested element type and I have been having problems with bug:

V8: Nested Content can't add multiple items #7630

Wondering if these could be related? Thank you in advance for any help.

ImageProcessor not working with UmbracoFileSystemProviders.Azure

$
0
0

I am having an issue getting ImageProcessor to work with images stored in an Azure Blob. I am using the latest version of the UmbracoFileSystemProviders.Azure plugin installed via nuget. The images are retrieved from the blob but none of the ImageProcessor query string parameters will work on the images.

i.e. http://localhost:12345/media/16058/image1.jpg?crop=0.040796245837117766,0,0.041288222827732549,0&cropmode=percentage&width=50&height=367&rnd=130875544740000000

This url was outputed by the GetCropUrl method. The full sized image is returned and not the cropped image. The blob container is public. Images are being cached just not processed. No broken image but the crops are being ignored.

I have this at the end of my main web.config:

  <imageProcessor>    
    <security configSource="config\imageprocessor\security.config" />
    <caching configSource="config\imageprocessor\cache.config" />
  </imageProcessor>

Here is my security.config:

<?xml version="1.0" encoding="utf-8"?>
<security>
  <services>
    <service name="LocalFileImageService" type="ImageProcessor.Web.Services.LocalFileImageService, ImageProcessor.Web" />
    <service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
      <settings>
        <setting key="Container" value="media-myclient"/>
        <setting key="MaxBytes" value="8194304"/>
        <setting key="Timeout" value="30000"/>
        <setting key="Host" value="http://myaccount.blob.core.windows.net/media-myclient"/>
      </settings>
    </service>
  </services>
</security>

Is the RemoteImageService service required or does the CloudImageService service handle relative urls so that I don't need to add the remote.axd to the url? The GitHub read me for the plugin does not show it but other posts do. If so, is the whitelist section required?

Here is the cache.config with DiskCache set:

<?xml version="1.0" encoding="utf-8"?>
<caching currentCache="DiskCache">
  <caches>
    <cache name="DiskCache" type="ImageProcessor.Web.Caching.DiskCache, ImageProcessor.Web" maxDays="365">
      <settings>
        <setting key="VirtualCachePath" value="~/app_data/cache" />
      </settings>
    </cache>
    <cache name="AzureBlobCache" type="ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache, ImageProcessor.Web.Plugins.AzureBlobCache" maxDays="365">
      <settings>
        <setting key="CachedStorageAccount" value="DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey" />
        <setting key="CachedBlobContainer" value="cache-client" />
        <setting key="UseCachedContainerInUrl" value="false" />
        <setting key="CachedCDNRoot" value="https://myaccount.azureedge.net/" />
        <setting key="CachedCDNTimeout" value="1000" />
        <setting key="SourceStorageAccount" value="DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey" />
        <setting key="SourceBlobContainer" value="media-client" />
        <setting key="StreamCachedImage" value="false" />
      </settings>
    </cache>
  </caches>
</caching>

I understand that putting the cache into the blob/CDN is better, but is it mandatory for this to work with ImageProcessor providers? Or have I just missed something here? Thanks.

Website down every day for a few minutes recurrently Umbraco 7.6.3 :(

$
0
0

Hi all, We are facing a serious issue because my website is getting this error every day on slave server on distributed environment. I'm using Umbraco 7.6.3 on Azure. About a week ago my website is down everyday and I only get this weird error on logs and I don't know what is happening on the app. The app availability is down for a couple of minutes and it keeps continue. How can we fix this?

2019-02-11 05:23:51,471 [P2188/D2/T43] ERROR Umbraco.Web.Scheduling.KeepAlive - Failed (at "https://{{websitedomain}}/umbraco").
System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Umbraco.Web.Scheduling.KeepAlive.<PerformRunAsync>d__4.MoveNext()
 2019-02-11 05:30:31,517 [P2188/D2/T48] ERROR Umbraco.Web.Scheduling.KeepAlive - Failed (at "https://{{websitedomain}}/umbraco").
System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Umbraco.Web.Scheduling.KeepAlive.<PerformRunAsync>d__4.MoveNext()

Than you.

Courier not moving selected values drop down list - Umbraco.DropDown.Flexible

Viewing all 72689 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>